diff -U4 -r ppp-2.4.4/pppd/ipcp.c ppp-2.4.4+ms-fix/pppd/ipcp.c --- ppp-2.4.4/pppd/ipcp.c 2005-08-26 00:59:34.000000000 +0100 +++ ppp-2.4.4+ms-fix/pppd/ipcp.c 2009-06-21 14:56:47.000000000 +0100 @@ -350,9 +350,9 @@ /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ - if (ipcp_allowoptions[0].dnsaddr[1] == 0) + if (ipcp_allowoptions[0].dnsaddr[1] == (u_int32_t) -1) ipcp_allowoptions[0].dnsaddr[0] = dns; else ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; @@ -386,9 +386,9 @@ /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ - if (ipcp_allowoptions[0].winsaddr[1] == 0) + if (ipcp_allowoptions[0].winsaddr[1] == (u_int32_t) -1) ipcp_allowoptions[0].winsaddr[0] = wins; else ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; @@ -591,8 +591,13 @@ * and defaultroute options. */ ao->proxy_arp = 1; ao->default_route = 1; + + ao->dnsaddr[0] = (u_int32_t) -1; + ao->dnsaddr[1] = (u_int32_t) -1; + ao->winsaddr[0] = (u_int32_t) -1; + ao->winsaddr[1] = (u_int32_t) -1; } /* @@ -1460,9 +1465,9 @@ /* Microsoft primary or secondary DNS request */ d = citype == CI_MS_DNS2; /* If we do not have a DNS address then we cannot send it */ - if (ao->dnsaddr[d] == 0 || + if (ao->dnsaddr[d] == (u_int32_t) -1 || cilen != CILEN_ADDR) { /* Check CI length */ orc = CONFREJ; /* Reject CI */ break; } @@ -1479,10 +1484,10 @@ case CI_MS_WINS2: /* Microsoft primary or secondary WINS request */ d = citype == CI_MS_WINS2; - /* If we do not have a DNS address then we cannot send it */ - if (ao->winsaddr[d] == 0 || + /* If we do not have a WINS address then we cannot send it */ + if (ao->winsaddr[d] == (u_int32_t) -1 || cilen != CILEN_ADDR) { /* Check CI length */ orc = CONFREJ; /* Reject CI */ break; } @@ -2113,16 +2118,17 @@ case CI_MS_DNS1: case CI_MS_DNS2: p += 2; GETLONG(cilong, p); - printer(arg, "ms-dns%d %I", code - CI_MS_DNS1 + 1, + printer(arg, "ms-dns%d %I", code == CI_MS_DNS1 ? 1 : 2, htonl(cilong)); break; case CI_MS_WINS1: case CI_MS_WINS2: p += 2; GETLONG(cilong, p); - printer(arg, "ms-wins %I", htonl(cilong)); + printer(arg, "ms-wins%d %I", code == CI_MS_WINS1 ? 1 : 2, + htonl(cilong)); break; } while (p < optend) { GETCHAR(code, p);