git: 8449762738b9 - main - if_ovpn: fix unused functions with NOINET / NOINET6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 04 Aug 2022 12:02:48 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=8449762738b9efb72f41883b3cdf79b21da3c9cd
commit 8449762738b9efb72f41883b3cdf79b21da3c9cd
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-08-04 08:13:09 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-08-04 12:00:32 +0000
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 0f700a9b43d0..37814783fe3f 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,