From: Pali Rohár Date: Fri, 1 Jan 2021 15:23:26 +0000 (+0100) Subject: pppoe: Check if PPPoE discovery socket was created X-Git-Tag: ppp-2.4.9~6 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=86eaed93a40528859aa19a172ae633987e9f2248;p=ppp.git pppoe: Check if PPPoE discovery socket was created Signed-off-by: Pali Rohár --- diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c index f705b5f..de9b816 100644 --- a/pppd/plugins/pppoe/plugin.c +++ b/pppd/plugins/pppoe/plugin.c @@ -213,6 +213,10 @@ PPPOEConnectDevice(void) } else { conn->discoverySocket = openInterface(conn->ifName, Eth_PPPOE_Discovery, conn->myEth); + if (conn->discoverySocket < 0) { + error("Failed to create PPPoE discovery socket: %m"); + goto errout; + } discovery(conn); if (conn->discoveryState != STATE_SESSION) { error("Unable to complete PPPoE Discovery");