X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fplugins%2Frp-pppoe%2Fdiscovery.c;h=937ea5228b49b83cbaf07f4425c3ff88b99e743f;hp=d2c3a898e70b937f0daee37259a62c2e55858b81;hb=6e6bb3246106e680463c106d1ee6b773fc4f9c5a;hpb=dbfeebc9adcf76a50c1d4e9035d5d481914edb43;ds=sidebyside diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c index d2c3a89..937ea52 100644 --- a/pppd/plugins/rp-pppoe/discovery.c +++ b/pppd/plugins/rp-pppoe/discovery.c @@ -9,7 +9,7 @@ ***********************************************************************/ static char const RCSID[] = -"$Id: discovery.c,v 1.1 2001/12/14 02:55:20 mostrows Exp $"; +"$Id: discovery.c,v 1.3 2004/11/04 10:07:37 paulus Exp $"; #include "pppoe.h" @@ -592,17 +592,16 @@ discovery(PPPoEConnection *conn) /* Skip discovery? */ if (conn->skipDiscovery) { conn->discoveryState = STATE_SESSION; - if (conn->killSession) { - sendPADT(conn, "RP-PPPoE: Session killed manually"); - exit(0); - } return; } do { padiAttempts++; if (padiAttempts > MAX_PADI_ATTEMPTS) { - rp_fatal("Timeout waiting for PADO packets"); + warn("Timeout waiting for PADO packets"); + close(conn->discoverySocket); + conn->discoverySocket = -1; + return; } sendPADI(conn); conn->discoveryState = STATE_SENT_PADI; @@ -621,15 +620,17 @@ discovery(PPPoEConnection *conn) /* If we're only printing access concentrator names, we're done */ if (conn->printACNames) { - printf("--------------------------------------------------\n"); - exit(0); + die(0); } timeout = PADI_TIMEOUT; do { padrAttempts++; if (padrAttempts > MAX_PADI_ATTEMPTS) { - rp_fatal("Timeout waiting for PADS packets"); + warn("Timeout waiting for PADS packets"); + close(conn->discoverySocket); + conn->discoverySocket = -1; + return; } sendPADR(conn); conn->discoveryState = STATE_SENT_PADR;