diff options
author | Arne Schwabe | 2023-11-28 12:14:47 +0100 |
---|---|---|
committer | Gert Doering | 2023-12-02 17:17:21 +0100 |
commit | efbedf213f659c48cfd55765360fdab7a6488dad (patch) | |
tree | ed5bf541f6cebb8c9280d64e3eff37057d7d0eeb /src | |
parent | 4d8ee61ce2c2a8b387773d33b4dd01bc2e147941 (diff) | |
download | openvpn-efbedf213f659c48cfd55765360fdab7a6488dad.zip openvpn-efbedf213f659c48cfd55765360fdab7a6488dad.tar.gz |
Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror
Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20231128111447.64445-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27581.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/openvpn/route.c | 8 | ||||
-rw-r--r-- | src/openvpn/tun.c | 11 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index ff64938..6cc112c 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2342,12 +2342,11 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, return; } -#ifndef _WIN32 +#if !defined(_WIN32) #if !defined(TARGET_LINUX) const char *gateway; -#else - int metric; #endif +#if !defined(TARGET_SOLARIS) bool gateway_needed = false; const char *device = tt->actual_name; if (r6->iface != NULL) /* vpn server special route */ @@ -2365,6 +2364,7 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, gateway_needed = true; } #endif +#endif struct gc_arena gc = gc_new(); struct argv argv = argv_new(); @@ -2395,7 +2395,7 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, msg( M_INFO, "delete_route_ipv6(%s/%d)", network, r6->netbits ); #if defined(TARGET_LINUX) - metric = -1; + int metric = -1; if ((r6->flags & RT_METRIC_DEFINED) && (r6->metric > 0)) { metric = r6->metric; diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 82ab6c0..f1b8699 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1900,7 +1900,7 @@ tun_dco_enabled(struct tuntap *tt) #endif -#if !(defined(_WIN32) || defined(TARGET_LINUX)) +#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS)) static void open_tun_generic(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt) @@ -2061,7 +2061,7 @@ open_tun_dco_generic(const char *dev, const char *dev_type, } #endif /* TARGET_LINUX || TARGET_FREEBSD*/ -#if !defined(_WIN32) +#if !(defined(_WIN32) || defined(TARGET_SOLARIS)) static void close_tun_generic(struct tuntap *tt) { @@ -2398,13 +2398,12 @@ void open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt, openvpn_net_ctx_t *ctx) { - int if_fd, ip_muxid, arp_muxid, arp_fd, ppa = -1; + int if_fd = -1, ip_muxid = -1, arp_muxid = -1, arp_fd = -1, ppa = -1; struct lifreq ifr; const char *ptr; - const char *ip_node, *arp_node; + const char *ip_node = NULL, *arp_node = NULL; const char *dev_tuntap_type; int link_type; - bool is_tun; struct strioctl strioc_if, strioc_ppa; /* improved generic TUN/TAP driver from @@ -2428,7 +2427,6 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun } dev_tuntap_type = "tun"; link_type = I_PLINK; - is_tun = true; } else if (tt->type == DEV_TYPE_TAP) { @@ -2440,7 +2438,6 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun arp_node = dev_node; dev_tuntap_type = "tap"; link_type = I_PLINK; /* was: I_LINK */ - is_tun = false; } else { |