X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fdiscovery.c;h=1c55b3680521e6501e25caf2db967cb173e7bedf;hb=a37b5cf877d2fe21370958d5a44e61c621c1adb7;hp=5569f3e06898c240c894da2454039349c468f54a;hpb=a352af45cf46af5de0c2b2377f0ca8e33776ad6c;p=ppp.git diff --git a/pppd/plugins/pppoe/discovery.c b/pppd/plugins/pppoe/discovery.c index 5569f3e..1c55b36 100644 --- a/pppd/plugins/pppoe/discovery.c +++ b/pppd/plugins/pppoe/discovery.c @@ -605,19 +605,18 @@ waitForPADS(PPPoEConnection *conn, int timeout) } /********************************************************************** -*%FUNCTION: discovery +*%FUNCTION: discovery1 *%ARGUMENTS: * conn -- PPPoE connection info structure *%RETURNS: * Nothing *%DESCRIPTION: -* Performs the PPPoE discovery phase +* Performs the PPPoE discovery phase 1 ***********************************************************************/ void -discovery(PPPoEConnection *conn) +discovery1(PPPoEConnection *conn) { int padiAttempts = 0; - int padrAttempts = 0; int timeout = conn->discoveryTimeout; do { @@ -634,8 +633,23 @@ discovery(PPPoEConnection *conn) timeout *= 2; } while (conn->discoveryState == STATE_SENT_PADI); +} + +/********************************************************************** +*%FUNCTION: discovery2 +*%ARGUMENTS: +* conn -- PPPoE connection info structure +*%RETURNS: +* Nothing +*%DESCRIPTION: +* Performs the PPPoE discovery phase 2 +***********************************************************************/ +void +discovery2(PPPoEConnection *conn) +{ + int padrAttempts = 0; + int timeout = conn->discoveryTimeout; - timeout = conn->discoveryTimeout; do { padrAttempts++; if (got_sigterm || padrAttempts > conn->discoveryAttempts) {