diff options
author | mvs <mvs@cvs.openbsd.org> | 2021-01-18 18:29:20 +0000 |
---|---|---|
committer | mvs <mvs@cvs.openbsd.org> | 2021-01-18 18:29:20 +0000 |
commit | 9e2720348e96f68dfed264c29a753678d6ee0954 (patch) | |
tree | 8d89405fcf7845826779ac22dc7213faa11a49aa /sys/net | |
parent | c8036a1d9cdd00d87c8b6d2bdfc2f0cca5ca7122 (diff) |
Convert ifunit() to if_unit(9).
ok sashan@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_pfsync.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 029c8f36f05..9f47717440f 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.280 2021/01/04 12:48:27 bluhm Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.281 2021/01/18 18:29:19 mvs Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -1391,7 +1391,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - if ((sifp = ifunit(pfsyncr.pfsyncr_syncdev)) == NULL) + if ((sifp = if_unit(pfsyncr.pfsyncr_syncdev)) == NULL) return (EINVAL); ifp0 = if_get(sc->sc_sync_ifidx); @@ -1418,6 +1418,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (!(sifp->if_flags & IFF_MULTICAST)) { sc->sc_sync_ifidx = 0; + if_put(sifp); return (EADDRNOTAVAIL); } @@ -1426,6 +1427,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if ((imo->imo_membership[0] = in_addmulti(&addr, sifp)) == NULL) { sc->sc_sync_ifidx = 0; + if_put(sifp); return (ENOBUFS); } imo->imo_num_memberships++; @@ -1448,6 +1450,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if_linkstatehook_add(sifp, &sc->sc_ltask); if_detachhook_add(sifp, &sc->sc_dtask); + if_put(sifp); pfsync_request_full_update(sc); |