diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-26 13:47:21 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-26 13:47:21 +0200 |
| commit | 3f9c2931992b8362c6a33be18d6cd6f831cc8623 (patch) | |
| tree | ab17fd9795c769eba9c272836ede969fb3b93327 /pkg/csource/linux_common.go | |
| parent | 5e7849c5d16ce9e941cb8ecadcabed7fc43566ce (diff) | |
executor: don't crash during tun setup if ipv6 is not enabled
Some options that tun initialization sets up are optional.
Don't fail if they are missing in kernel.
Diffstat (limited to 'pkg/csource/linux_common.go')
| -rw-r--r-- | pkg/csource/linux_common.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/csource/linux_common.go b/pkg/csource/linux_common.go index d8dae4b22..4bc98c820 100644 --- a/pkg/csource/linux_common.go +++ b/pkg/csource/linux_common.go @@ -519,16 +519,16 @@ static void initialize_tun(void) tun_frags_enabled = (ifr.ifr_flags & IFF_NAPI_FRAGS) != 0; debug("tun_frags_enabled=%d\n", tun_frags_enabled); - execute_command(1, "sysctl -w net.ipv6.conf.%s.accept_dad=0", TUN_IFACE); + execute_command(0, "sysctl -w net.ipv6.conf.%s.accept_dad=0", TUN_IFACE); - execute_command(1, "sysctl -w net.ipv6.conf.%s.router_solicitations=0", TUN_IFACE); + execute_command(0, "sysctl -w net.ipv6.conf.%s.router_solicitations=0", TUN_IFACE); execute_command(1, "ip link set dev %s address %s", TUN_IFACE, LOCAL_MAC); execute_command(1, "ip addr add %s/24 dev %s", LOCAL_IPV4, TUN_IFACE); - execute_command(1, "ip -6 addr add %s/120 dev %s", LOCAL_IPV6, TUN_IFACE); execute_command(1, "ip neigh add %s lladdr %s dev %s nud permanent", REMOTE_IPV4, REMOTE_MAC, TUN_IFACE); - execute_command(1, "ip -6 neigh add %s lladdr %s dev %s nud permanent", + execute_command(0, "ip -6 addr add %s/120 dev %s", LOCAL_IPV6, TUN_IFACE); + execute_command(0, "ip -6 neigh add %s lladdr %s dev %s nud permanent", REMOTE_IPV6, REMOTE_MAC, TUN_IFACE); execute_command(1, "ip link set dev %s up", TUN_IFACE); } |
