]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/pppoe/plugin.c
pppoe: Split function discovery() into phases discovery1() and discovery2()
[ppp.git] / pppd / plugins / pppoe / plugin.c
index d7c5be1d9ee6f77f00968bd45d76b21e4ef2ac38..57324607d9e9acc7226a802b8d019544602c2f90 100644 (file)
@@ -216,9 +216,14 @@ PPPOEConnectDevice(void)
            error("Failed to create PPPoE discovery socket: %m");
            goto errout;
        }
-       discovery(conn);
+       discovery1(conn);
+       if (conn->discoveryState != STATE_RECEIVED_PADO) {
+           error("Unable to complete PPPoE Discovery phase 1");
+           goto errout;
+       }
+       discovery2(conn);
        if (conn->discoveryState != STATE_SESSION) {
-           error("Unable to complete PPPoE Discovery");
+           error("Unable to complete PPPoE Discovery phase 2");
            goto errout;
        }
     }