From: mvs Date: Tue, 19 Jan 2021 19:38:29 +0000 (+0000) Subject: pppoe(4): convert ifunit() to if_unit(9) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0f1fc83dd318b8a5ce39b45b1d9e6ac3bb7b22e4;p=openbsd pppoe(4): convert ifunit() to if_unit(9) ok dlg@ kn@ --- diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c index b6ece4239b2..a31b3e3f4fe 100644 --- a/sys/net/if_pppoe.c +++ b/sys/net/if_pppoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppoe.c,v 1.76 2021/01/04 21:21:41 kn Exp $ */ +/* $OpenBSD: if_pppoe.c,v 1.77 2021/01/19 19:38:29 mvs Exp $ */ /* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */ /* @@ -793,8 +793,9 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) if (parms->eth_ifname[0] != '\0') { struct ifnet *eth_if; - eth_if = ifunit(parms->eth_ifname); + eth_if = if_unit(parms->eth_ifname); if (eth_if == NULL || eth_if->if_type != IFT_ETHER) { + if_put(eth_if); sc->sc_eth_ifidx = 0; return (ENXIO); } @@ -805,6 +806,7 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) PPPOE_OVERHEAD; } sc->sc_eth_ifidx = eth_if->if_index; + if_put(eth_if); } if (sc->sc_concentrator_name)