summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2021-01-19 07:31:48 +0000
committermvs <mvs@cvs.openbsd.org>2021-01-19 07:31:48 +0000
commit5796efb0a449c561756711612f48b71d25c34013 (patch)
tree877b77be0e9f527bd4f5f2c37070132e8ca62abc
parentddc65a36b3b31f6b199d43267265c4a3354b8903 (diff)
gre(4): convert ifunit() to if_unit(9)
ok dlg@
-rw-r--r--sys/net/if_gre.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index cbe26346715..cf5b51292a6 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.163 2020/12/12 11:49:02 jan Exp $ */
+/* $OpenBSD: if_gre.c,v 1.164 2021/01/19 07:31:47 mvs Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -3753,15 +3753,18 @@ nvgre_set_parent(struct nvgre_softc *sc, const char *parent)
{
struct ifnet *ifp0;
- ifp0 = ifunit(parent); /* doesn't need an if_put */
+ ifp0 = if_unit(parent);
if (ifp0 == NULL)
return (EINVAL);
- if (!ISSET(ifp0->if_flags, IFF_MULTICAST))
+ if (!ISSET(ifp0->if_flags, IFF_MULTICAST)) {
+ if_put(ifp0);
return (EPROTONOSUPPORT);
+ }
/* commit */
sc->sc_ifp0 = ifp0->if_index;
+ if_put(ifp0);
return (0);
}