X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fipcp.c;h=e9738fe4d894dd9291317412e4a8a93d331db19c;hb=f8c05f21cc743132fb7c4b996568c09a374725b9;hp=cb873bbd3e836a8501a089fab1786cf8dc68b86f;hpb=275b3d6e8901b22a609567717f7dab56c8b67f2d;p=ppp.git diff --git a/pppd/ipcp.c b/pppd/ipcp.c index cb873bb..e9738fe 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -575,6 +575,14 @@ ipcp_init(unit) f->callbacks = &ipcp_callbacks; fsm_init(&ipcp_fsm[unit]); + /* + * Some 3G modems use repeated IPCP NAKs as a way of stalling + * until they can contact a server on the network, so we increase + * the default number of NAKs we accept before we start treating + * them as rejects. + */ + f->maxnakloops = 100; + memset(wo, 0, sizeof(*wo)); memset(ao, 0, sizeof(*ao)); @@ -954,6 +962,21 @@ ipcp_ackci(f, p, len) goto bad; \ } +#define ACKCIWINS(opt, addr) \ + if (addr) { \ + u_int32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = htonl(l); \ + if (addr != cilong) \ + goto bad; \ + } + ACKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, go->hisaddr); @@ -966,6 +989,10 @@ ipcp_ackci(f, p, len) ACKCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); + ACKCIWINS(CI_MS_WINS1, go->winsaddr[0]); + + ACKCIWINS(CI_MS_WINS2, go->winsaddr[1]); + /* * If there are any remaining CIs, then this packet is bad. */