vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Please test the following diff if you're using any kernel PPPoE interfaces. Adapt maximum MTU permitted on pppoe(4) interfaces to the MTU of the connected Ethernet/VLAN interface. Index: if_pppoe.c ================================================== ================= RCS file: /cvs/src/sys/net/if_pppoe.c,v retrieving revision 1.16 diff -u -p -r1.16 if_pppoe.c --- if_pppoe.c 14 Mar 2008 02:56:26 -0000 1.16 +++ if_pppoe.c 14 Mar 2008 03:02:33 -0000 @@ -88,6 +88,7 @@ struct pppoetag { } __packed; #define PPPOE_HEADERLEN sizeof(struct pppoehdr) +#define PPPOE_OVERHEAD (PPPOE_HEADERLEN + 2) #define PPPOE_VERTYPE 0x11 /* VER=1, TYPE = 1 */ #define PPPOE_TAG_EOL 0x0000 /* end of list */ @@ -108,7 +109,7 @@ struct pppoetag { #define PPPOE_CODE_PADT 0xA7 /* Active Discovery Terminate */ /* two byte PPP protocol discriminator, then IP data */ -#define PPPOE_MAXMTU (ETHERMTU - PPPOE_HEADERLEN - 2) +#define PPPOE_MAXMTU (ETHERMTU - PPPOE_OVERHEAD) /* Add a 16 bit unsigned value to a buffer pointed to by PTR */ #define PPPOE_ADD_16(PTR, VAL) \ @@ -899,13 +900,22 @@ pppoe_ioctl(struct ifnet *ifp, unsigned if ((error = suser(p, p->p_acflag)) != 0) return (error); if (parms->eth_ifname[0] != '\0') { - sc->sc_eth_if = ifunit(parms->eth_ifname); - if (sc->sc_eth_if == NULL || - (sc->sc_eth_if->if_type != IFT_ETHER && - sc->sc_eth_if->if_type != IFT_L2VLAN)) { + struct ifnet *eth_if; + + eth_if = ifunit(parms->eth_ifname); + if (eth_if == NULL || + (eth_if->if_type != IFT_ETHER && + eth_if->if_type != IFT_L2VLAN)) { sc->sc_eth_if = NULL; return (ENXIO); } + + if (sc->sc_sppp.pp_if.if_mtu > + eth_if->if_mtu - PPPOE_OVERHEAD) { + sc->sc_sppp.pp_if.if_mtu = eth_if->if_mtu - + PPPOE_OVERHEAD; + } + sc->sc_eth_if = eth_if; } if (sc->sc_concentrator_name) @@ -997,7 +1007,8 @@ pppoe_ioctl(struct ifnet *ifp, unsigned { struct ifreq *ifr = (struct ifreq *)data; - if (ifr->ifr_mtu > PPPOE_MAXMTU) + if (ifr->ifr_mtu > (sc->sc_eth_if == NULL ? + PPPOE_MAXMTU : (sc->sc_eth_if->if_mtu - PPPOE_OVERHEAD))) return (EINVAL); return (sppp_ioctl(ifp, cmd, data)); } -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. |