Skip to content

Commit

Permalink
tun: removed unnecessary route installations
Browse files Browse the repository at this point in the history
Removed superfluous calls to 'add_route_ipv6' for adding ipv6 routes after tun opening in OpenBSD, NetBSD and Darwin.

Change-Id: I235891212b15277349810913c9c1763da5c48587
Signed-off-by: Marco Baffo <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg29217.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
mrbff authored and cron2 committed Sep 12, 2024
1 parent f4d7cec commit 992da81
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/openvpn/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,7 @@ init_tun_post(struct tuntap *tt,
#endif /* ifdef _WIN32 */
}

#if defined(_WIN32) \
|| defined(TARGET_DARWIN) || defined(TARGET_NETBSD) || defined(TARGET_OPENBSD)
#if defined(_WIN32)

/* some of the platforms will auto-add a "network route" pointing
* to the interface on "ifconfig tunX 2001:db8::1/64", others need
Expand Down Expand Up @@ -1200,11 +1199,6 @@ do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, int tun_mtu,
"FreeBSD BSD 'ifconfig inet6 -ifdisabled' failed");
#endif

#if defined(TARGET_OPENBSD) || defined(TARGET_NETBSD) \
|| defined(TARGET_DARWIN)
/* and, hooray, we explicitly need to add a route... */
add_route_connected_v6_net(tt, es);
#endif
#elif defined(TARGET_AIX)
argv_printf(&argv, "%s %s inet6 %s/%d mtu %d up", IFCONFIG_PATH, ifname,
ifconfig_ipv6_local, tt->netbits_ipv6, tun_mtu);
Expand Down

0 comments on commit 992da81

Please sign in to comment.