diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2015-06-30 08:22:29 +0200 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2015-06-30 08:22:29 +0200 |
commit | 6149d88c5a2c58a9cc943ca02c36e8ee4e5d1751 (patch) | |
tree | 0fdc36dba5e216faf7ade9d7b327090b4a20bd2b /src/openvpn/route.c | |
parent | 63862ed15e1abb4b29c5a43b469321c928613c62 (diff) |
Imported Upstream version 2.3.7upstream/2.3.7
Diffstat (limited to 'src/openvpn/route.c')
-rw-r--r-- | src/openvpn/route.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index cc85e4d..2acfbe8 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -838,7 +838,7 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u if ( rl && rl->flags & RG_ENABLE ) { - if (!(rl->spec.flags & RTSA_REMOTE_ENDPOINT)) + if (!(rl->spec.flags & RTSA_REMOTE_ENDPOINT) && (rl->flags & RG_REROUTE_GW)) { msg (M_WARN, "%s VPN gateway parameter (--route-gateway or --ifconfig) is missing", err); } @@ -2601,7 +2601,7 @@ get_default_gateway (struct route_gateway_info *rgi) gc_free (&gc); } -#elif defined(TARGET_FREEBSD)||defined(TARGET_DRAGONFLY) +#elif defined(TARGET_FREEBSD)||defined(TARGET_DRAGONFLY)||defined(TARGET_SOLARIS) #include <sys/types.h> #include <sys/socket.h> @@ -2629,6 +2629,8 @@ get_default_gateway (struct route_gateway_info *rgi) struct sockaddr *gate = NULL, *sa; struct rt_msghdr *rtm_aux; +#if defined(TARGET_FREEBSD)||defined(TARGET_DRAGONFLY) + #define NEXTADDR(w, u) \ if (rtm_addrs & (w)) {\ l = ROUNDUP(u.sa_len); memmove(cp, &(u), l); cp += l;\ @@ -2636,6 +2638,18 @@ get_default_gateway (struct route_gateway_info *rgi) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) +#else /* TARGET_SOLARIS */ + +#define NEXTADDR(w, u) \ + if (rtm_addrs & (w)) {\ + l = ROUNDUP(sizeof(struct sockaddr_in)); memmove(cp, &(u), l); cp += l;\ + } + +#define ADVANCE(x, n) (x += ROUNDUP(sizeof(struct sockaddr_in))) + +#endif + + #define rtm m_rtmsg.m_rtm CLEAR(*rgi); @@ -2655,9 +2669,12 @@ get_default_gateway (struct route_gateway_info *rgi) rtm.rtm_addrs = rtm_addrs; so_dst.sa_family = AF_INET; - so_dst.sa_len = sizeof(struct sockaddr_in); so_mask.sa_family = AF_INET; + +#if defined(TARGET_FREEBSD)||defined(TARGET_DRAGONFLY) + so_dst.sa_len = sizeof(struct sockaddr_in); so_mask.sa_len = sizeof(struct sockaddr_in); +#endif NEXTADDR(RTA_DST, so_dst); NEXTADDR(RTA_NETMASK, so_mask); |