From 86eaed93a40528859aa19a172ae633987e9f2248 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Fri, 1 Jan 2021 16:23:26 +0100 Subject: [PATCH] pppoe: Check if PPPoE discovery socket was created MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Pali Rohár --- pppd/plugins/pppoe/plugin.c | 4 ++++ 1 file changed, 4 insertions(+) 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"); -- 2.39.2