X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fipcp.c;h=6250c7e6921bd9813b1da35d6a51bbb12c991343;hb=1ab9ab93491c12576fa771db9388bf6ab76c788c;hp=5752dd66581ad7cc6c4fe52850a51d2a7f8cb38b;hpb=2db4a9ae219399e01d11af9e219193d54288a35c;p=ppp.git diff --git a/pppd/ipcp.c b/pppd/ipcp.c index 5752dd6..6250c7e 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: ipcp.c,v 1.30 1997/03/04 03:39:10 paulus Exp $"; +static char rcsid[] = "$Id: ipcp.c,v 1.34 1998/04/28 23:38:09 paulus Exp $"; #endif /* @@ -604,7 +604,7 @@ ipcp_nakci(f, p, len) no.neg_vj = 1; break; case CI_ADDRS: - if (go->neg_addr && go->old_addrs || no.old_addrs + if ((go->neg_addr && go->old_addrs) || no.old_addrs || cilen != CILEN_ADDRS) goto bad; try.neg_addr = 1; @@ -1085,10 +1085,12 @@ ip_check_options() option_error("remote IP address required for demand-dialling\n"); exit(1); } +#if 0 if (demand && wo->accept_remote) { option_error("ipcp-accept-remote is incompatible with demand\n"); exit(1); } +#endif } @@ -1155,6 +1157,8 @@ ipcp_up(f) ipcp_close(f->unit, "Could not determine local IP address"); return; } + script_setenv("IPLOCAL", ip_ntoa(go->ouraddr)); + script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr)); /* * Check that the peer is allowed to use the IP address it wants. @@ -1269,8 +1273,6 @@ static void ipcp_down(f) fsm *f; { - u_int32_t ouraddr, hisaddr; - IPCPDEBUG((LOG_INFO, "ipcp: down")); np_down(f->unit, PPP_IP); sifvjcomp(f->unit, 0, 0, 0); @@ -1409,9 +1411,9 @@ ipcp_printpkt(p, plen, printer, arg) if (olen == CILEN_ADDRS) { p += 2; GETLONG(cilong, p); - printer(arg, "addrs %s", ip_ntoa(htonl(cilong))); + printer(arg, "addrs %I", htonl(cilong)); GETLONG(cilong, p); - printer(arg, " %s", ip_ntoa(htonl(cilong))); + printer(arg, " %I", htonl(cilong)); } break; case CI_COMPRESSTYPE: @@ -1435,20 +1437,20 @@ ipcp_printpkt(p, plen, printer, arg) if (olen == CILEN_ADDR) { p += 2; GETLONG(cilong, p); - printer(arg, "addr %s", ip_ntoa(htonl(cilong))); + printer(arg, "addr %I", htonl(cilong)); } break; case CI_MS_DNS1: case CI_MS_DNS2: p += 2; GETLONG(cilong, p); - printer(arg, "dns-addr %s", ip_ntoa(htonl(cilong))); + printer(arg, "ms-dns %I", htonl(cilong)); break; case CI_MS_WINS1: case CI_MS_WINS2: p += 2; GETLONG(cilong, p); - printer(arg, "wins-addr %s", ip_ntoa(htonl(cilong))); + printer(arg, "ms-wins %I", htonl(cilong)); break; } while (p < optend) {