]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/pppoe/plugin.c
Merge pull request #296 from enaess/ppp-autotools
[ppp.git] / pppd / plugins / pppoe / plugin.c
index f705b5facd7392fcc940b89b31c2ee7bb3e9ed3d..8bcd1f8d0306d372997647d0e5c9221836057919 100644 (file)
 static char const RCSID[] =
 "$Id: plugin.c,v 1.17 2008/06/15 04:35:50 paulus Exp $";
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #define _GNU_SOURCE 1
 #include "pppoe.h"
 
@@ -213,6 +217,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");