diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-03-14 02:56:27 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-03-14 02:56:27 +0000 |
commit | 9001470ad8e60c6699e10cda5a88b922f9218144 (patch) | |
tree | 30bfbd832c0dde4b03ae638ad07e301fa7e61aa1 | |
parent | cda8833d4db159de81d5738eee816e7c9fd46b23 (diff) |
Do not allow pppoe(4) interfaces to be attached to anything but Ethernet
or VLAN interfaces.
Based on a similar change from NetBSD.
ok canacar@
-rw-r--r-- | sys/net/if_pppoe.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c index 18f213d3581..6a929b1836a 100644 --- a/sys/net/if_pppoe.c +++ b/sys/net/if_pppoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppoe.c,v 1.15 2008/03/12 17:27:03 canacar Exp $ */ +/* $OpenBSD: if_pppoe.c,v 1.16 2008/03/14 02:56:26 brad Exp $ */ /* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */ /* @@ -900,8 +900,12 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) return (error); if (parms->eth_ifname[0] != '\0') { sc->sc_eth_if = ifunit(parms->eth_ifname); - if (sc->sc_eth_if == NULL) + if (sc->sc_eth_if == NULL || + (sc->sc_eth_if->if_type != IFT_ETHER && + sc->sc_eth_if->if_type != IFT_L2VLAN)) { + sc->sc_eth_if = NULL; return (ENXIO); + } } if (sc->sc_concentrator_name) |