X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fplugins%2Frp-pppoe%2Fdiscovery.c;h=fd851def2fededf5f53bb64fd7681406ad598fcf;hp=a4e4cec93ce1c21ebd8841813b6ee33cdc67d13f;hb=c319558b8cacad7d27f04c7d612e44b67f273434;hpb=0bc11fba4e57d6fabfdce20bef07d4dd4d6ef38c diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c index a4e4cec..fd851de 100644 --- a/pppd/plugins/rp-pppoe/discovery.c +++ b/pppd/plugins/rp-pppoe/discovery.c @@ -369,7 +369,7 @@ waitForPADO(PPPoEConnection *conn, int timeout) while(1) { r = select(conn->discoverySocket+1, &readable, NULL, NULL, &tv); - if (r >= 0 || errno != EINTR) break; + if (r >= 0 || errno != EINTR || got_sigterm) break; } if (r < 0) { error("select (waitForPADO): %m"); @@ -550,7 +550,7 @@ waitForPADS(PPPoEConnection *conn, int timeout) while(1) { r = select(conn->discoverySocket+1, &readable, NULL, NULL, &tv); - if (r >= 0 || errno != EINTR) break; + if (r >= 0 || errno != EINTR || got_sigterm) break; } if (r < 0) { error("select (waitForPADS): %m"); @@ -622,7 +622,7 @@ discovery(PPPoEConnection *conn) do { padiAttempts++; - if (padiAttempts > conn->discoveryAttempts) { + if (got_sigterm || 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 > conn->discoveryAttempts) { + if (got_sigterm || padrAttempts > conn->discoveryAttempts) { warn("Timeout waiting for PADS packets"); close(conn->discoverySocket); conn->discoverySocket = -1;