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")
This commit is contained in:
Kristof Provost 2022-08-04 10:13:09 +02:00
parent 5abe178970
commit 8449762738
1 changed files with 4 additions and 0 deletions

View File

@ -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,