From 8449762738b9efb72f41883b3cdf79b21da3c9cd Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 4 Aug 2022 10:13:09 +0200 Subject: [PATCH] if_ovpn: fix unused functions with NOINET / NOINET6 ovpn_find_peer_by_ip() is not used if INET is not defined. Do not define the function in that case. Same for ovpn_find_peer_by_ip6(). Fix these warnings: /usr/src/sys/net/if_ovpn.c:1580:1: warning: unused function 'ovpn_find_peer_by_ip' [-Wunused-function] ovpn_find_peer_by_ip(struct ovpn_softc *sc, const struct in_addr addr) ^ /usr/src/sys/net/if_ovpn.c:1599:1: warning: unused function 'ovpn_find_peer_by_ip6' [-Wunused-function] ovpn_find_peer_by_ip6(struct ovpn_softc *sc, const struct in6_addr *addr) ^ Reported by: mjg Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 0f700a9b43d..37814783fe3 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -1576,6 +1576,7 @@ ovpn_get_af(struct mbuf *m) return (0); } +#ifdef INET static struct ovpn_kpeer * ovpn_find_peer_by_ip(struct ovpn_softc *sc, const struct in_addr addr) { @@ -1594,7 +1595,9 @@ ovpn_find_peer_by_ip(struct ovpn_softc *sc, const struct in_addr addr) return (peer); } +#endif +#ifdef INET6 static struct ovpn_kpeer * ovpn_find_peer_by_ip6(struct ovpn_softc *sc, const struct in6_addr *addr) { @@ -1613,6 +1616,7 @@ ovpn_find_peer_by_ip6(struct ovpn_softc *sc, const struct in6_addr *addr) return (peer); } +#endif static struct ovpn_kpeer * ovpn_route_peer(struct ovpn_softc *sc, struct mbuf **m0,