X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Frp-pppoe%2Fdiscovery.c;h=a4e4cec93ce1c21ebd8841813b6ee33cdc67d13f;hb=b1fcf16fa66159f380ee4abd7c9a76b59809dc7b;hp=16a59f77f09b0761951684d8868c277913066abd;hpb=c9d9dbfb8459b528ab56bd1cf0c41460801bbfdf;p=ppp.git diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c index 16a59f7..a4e4cec 100644 --- a/pppd/plugins/rp-pppoe/discovery.c +++ b/pppd/plugins/rp-pppoe/discovery.c @@ -45,8 +45,8 @@ static int time_left(struct timeval *diff, struct timeval *exp) { struct timeval now; - if (gettimeofday(&now, NULL) < 0) { - error("gettimeofday: %m"); + if (get_time(&now) < 0) { + error("get_time: %m"); return 0; } @@ -353,8 +353,8 @@ waitForPADO(PPPoEConnection *conn, int timeout) conn->seenMaxPayload = 0; conn->error = 0; - if (gettimeofday(&expire_at, NULL) < 0) { - error("gettimeofday (waitForPADO): %m"); + if (get_time(&expire_at) < 0) { + error("get_time (waitForPADO): %m"); return; } expire_at.tv_sec += timeout; @@ -533,8 +533,8 @@ waitForPADS(PPPoEConnection *conn, int timeout) PPPoEPacket packet; int len; - if (gettimeofday(&expire_at, NULL) < 0) { - error("gettimeofday (waitForPADS): %m"); + if (get_time(&expire_at) < 0) { + error("get_time (waitForPADS): %m"); return; } expire_at.tv_sec += timeout; @@ -622,7 +622,7 @@ discovery(PPPoEConnection *conn) do { padiAttempts++; - if (padiAttempts > MAX_PADI_ATTEMPTS) { + if (padiAttempts > conn->discoveryAttempts) { warn("Timeout waiting for PADO packets"); close(conn->discoverySocket); conn->discoverySocket = -1; @@ -638,7 +638,7 @@ discovery(PPPoEConnection *conn) timeout = conn->discoveryTimeout; do { padrAttempts++; - if (padrAttempts > MAX_PADI_ATTEMPTS) { + if (padrAttempts > conn->discoveryAttempts) { warn("Timeout waiting for PADS packets"); close(conn->discoverySocket); conn->discoverySocket = -1;