]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Avoid unused function warning/error on FreeBSD (and potientially others)
authorArne Schwabe <arne@rfc2549.org>
Sat, 1 Jul 2023 20:24:53 +0000 (22:24 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 2 Jul 2023 08:12:40 +0000 (10:12 +0200)
the funktion is_on_link is not used on FreeBSD and triggers a
warning/error (-Werror) on FreeBSD.

Patch v2: use actual platforms instead an ifndef FreeBSD

Change-Id: I6757d6509ff3ff522d6de417372a21e73ccca3ba
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230701202453.3517822-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26804.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c

index d18acd0165c9c4cbe70baad7537f255a93ac3e26..0d04a5a33c8c193adf5a61b71565742e866b9133 100644 (file)
@@ -1541,13 +1541,15 @@ local_route(in_addr_t network,
     return LR_NOMATCH;
 }
 
-/* Return true if the "on-link" form of the route should be used.  This is when the gateway for a
+/* Return true if the "on-link" form of the route should be used.  This is when the gateway for
  * a route is specified as an interface rather than an address. */
+#if defined(TARGET_LINUX) || defined(_WIN32) || defined(TARGET_DARWIN)
 static inline bool
 is_on_link(const int is_local_route, const unsigned int flags, const struct route_gateway_info *rgi)
 {
     return rgi && (is_local_route == LR_MATCH || ((flags & ROUTE_REF_GW) && (rgi->flags & RGI_ON_LINK)));
 }
+#endif
 
 bool
 add_route(struct route_ipv4 *r,