X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fipcp.c;h=4e1f52f5c9ad6aeed3a8c803219d0d121248b028;hp=310f869067ef2b3484e4106d52ff1e1a63d7dbee;hb=8d2b8187352766197e43a8be3f350acc91a65381;hpb=08b5e975f6d15eae1998b76d2aea04186e039cc9 diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 310f869..4e1f52f 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: ipcp.c,v 1.15 1995/04/24 05:58:38 paulus Exp $"; +static char rcsid[] = "$Id: ipcp.c,v 1.18 1995/05/19 03:18:08 paulus Exp $"; #endif /* @@ -575,13 +575,13 @@ ipcp_nakci(f, p, len) case CI_ADDR: if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) goto bad; - try.neg_addr = 1; try.old_addrs = 0; GETLONG(l, p); ciaddr1 = htonl(l); if (ciaddr1 && go->accept_local) try.ouraddr = ciaddr1; - no.neg_addr = 1; + if (try.ouraddr != 0) + no.neg_addr = 1; break; default: goto bad; @@ -778,6 +778,13 @@ ipcp_reqci(f, inp, len, reject_if_disagree) tl = ntohl(wo->hisaddr); PUTLONG(tl, p); } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * If neither we nor he knows his address, reject the option. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; } /* @@ -832,6 +839,13 @@ ipcp_reqci(f, inp, len, reject_if_disagree) tl = ntohl(wo->hisaddr); PUTLONG(tl, p); } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * Don't ACK an address of 0.0.0.0 - reject it instead. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; } ho->neg_addr = 1; @@ -874,7 +888,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree) } } ho->maxslotindex = maxslotindex; - ho->cflag = wo->cflag; + ho->cflag = cflag; } else { ho->old_vj = 1; ho->maxslotindex = MAX_STATES - 1;