Date: Mon, 10 Feb 2003 05:20:02 -0800 (PST) From: Gleb Smirnoff <glebius@cell.sick.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/47920: if ng_pppoe switches to nonstandard mode it stays in it forever Message-ID: <200302101320.h1ADK2mE024400@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/47920; it has been noted by GNATS. From: Gleb Smirnoff <glebius@cell.sick.ru> To: Lev Shamardin <shamardin@theory.sinp.msu.ru> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/47920: if ng_pppoe switches to nonstandard mode it stays in it forever Date: Mon, 10 Feb 2003 16:16:08 +0300 Hi! A workaround and fix of the problem follows. L> cause inoperability of the whole PPPoE network, because the only way to L> switch pppoe back to standard mode is to reboot the kernel, and if the L> FreeBSD client reconnects to the server, this will bring the server back to L> non-standard mode. Really you do not need to reboot, but you can switch it back using: sysctl net.graph.nonstandard_pppoe=0 But it will remain in standard mode until next stupid packet in the network. The dirty workaround we used is running this command in cron(8). L> >Fix: L> There should be a kernel option or sysctl variable which can disable usage L> of non-standard pppoe mode. Here is the patch we are using now. It is not tested thoroughly because I don't know where does non-standard packets come from, and I do not generated them for testing purposes. But this should work. The oid net.graph.nonstandard_pppoe gets new value of -1, which means "stay standard forever!". --- ng_pppoe.c.orig Mon Feb 10 15:16:04 2003 +++ ng_pppoe.c Mon Feb 10 15:41:40 2003 @@ -166,7 +166,6 @@ ETHERTYPE_PPPOE_DISC}; static int nonstandard; -static int ngpppoe_set_ethertype(SYSCTL_HANDLER_ARGS) { int error; @@ -176,12 +175,19 @@ error = sysctl_handle_int(oidp, &val, sizeof(int), req); if (error != 0 || req->newptr == NULL) return (error); - if (val == 1) { + switch (val) { + case 1: nonstandard = 1; eh_prototype.ether_type = ETHERTYPE_PPPOE_STUPID_DISC; - } else { + break; + case 0: nonstandard = 0; eh_prototype.ether_type = ETHERTYPE_PPPOE_DISC; + break; + case -1: + nonstandard = -1; + eh_prototype.ether_type = ETHERTYPE_PPPOE_DISC; + break; } return (0); } @@ -913,8 +919,10 @@ code = wh->ph.code; switch(wh->eh.ether_type) { case ETHERTYPE_PPPOE_STUPID_DISC: - nonstandard = 1; - eh_prototype.ether_type = ETHERTYPE_PPPOE_STUPID_DISC; + if (nonstandard > -1) { + nonstandard = 1; + eh_prototype.ether_type = ETHERTYPE_PPPOE_STUPID_DISC; + } /* fall through */ case ETHERTYPE_PPPOE_DISC: /* -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302101320.h1ADK2mE024400>