From: Simon Farnsworth Date: Sun, 1 Mar 2015 11:49:06 +0000 (+0000) Subject: Suppress false error message on PPPoE disconnect X-Git-Tag: ppp-2.4.8~47^2 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=219aac3b53d0827549377f1bfe22853ee52d4405 Suppress false error message on PPPoE disconnect Once the kernel handles PPPoE PADTs correctly[1], a PADT triggered disconnect will result in EALREADY when pppd tries to clear the session ID. Simply ignore the error if, and only if, the error is EALREADY [1] https://patchwork.ozlabs.org/patch/444717/ Signed-off-by: Simon Farnsworth --- diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c index a8c2bb4..da50cdf 100644 --- a/pppd/plugins/rp-pppoe/plugin.c +++ b/pppd/plugins/rp-pppoe/plugin.c @@ -270,7 +270,7 @@ PPPOEDisconnectDevice(void) memcpy(sp.sa_addr.pppoe.dev, conn->ifName, IFNAMSIZ); memcpy(sp.sa_addr.pppoe.remote, conn->peerEth, ETH_ALEN); if (connect(conn->sessionSocket, (struct sockaddr *) &sp, - sizeof(struct sockaddr_pppox)) < 0) + sizeof(struct sockaddr_pppox)) < 0 && errno != EALREADY) error("Failed to disconnect PPPoE socket: %d %m", errno); close(conn->sessionSocket); /* don't send PADT?? */