Module Name: src Committed By: knakahara Date: Mon Aug 15 08:28:41 UTC 2022
Modified Files: src/sys/net: if_pppoe.c Log Message: Fix stall on PPPOE_STATE_PADR_SENT, suggested by martin@n.o, thanks. Just drop such large PADO frames, ok'ed by yamaguchi@n.o. I left if_pppoe.c:r1.182 code because that fixes other issues such as pppoe(4) stall in PPPOE_STATE_PADR_SENT when the PADO sender never replys. To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/net/if_pppoe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_pppoe.c diff -u src/sys/net/if_pppoe.c:1.182 src/sys/net/if_pppoe.c:1.183 --- src/sys/net/if_pppoe.c:1.182 Fri Aug 12 06:24:03 2022 +++ src/sys/net/if_pppoe.c Mon Aug 15 08:28:41 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: if_pppoe.c,v 1.182 2022/08/12 06:24:03 knakahara Exp $ */ +/* $NetBSD: if_pppoe.c,v 1.183 2022/08/15 08:28:41 knakahara Exp $ */ /* * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.182 2022/08/12 06:24:03 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.183 2022/08/15 08:28:41 knakahara Exp $"); #ifdef _KERNEL_OPT #include "pppoe.h" @@ -988,6 +988,19 @@ breakbreak:; sc->sc_padr_retried = 0; sc->sc_state = PPPOE_STATE_PADR_SENT; if ((err = pppoe_send_padr(sc)) != 0) { + if (err == ENOBUFS) { + pppoe_printf(sc, "PADO is too large, drop it\n"); + /* + * Cannot send PADR generated by received PADO, + * so restart from sending PAD*I*. + */ + sc->sc_state = PPPOE_STATE_PADI_SENT; + callout_schedule(&sc->sc_timeout, + PPPOE_DISC_TIMEOUT * (1 + sc->sc_padi_retried)); + PPPOE_UNLOCK(sc); + goto done; + } + pppoe_printf(sc, "failed to send PADR, error=%d\n", err); }