]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/ipcp.c
Allow proxyarp and defaultroute by default.
[ppp.git] / pppd / ipcp.c
index abeae25b4d1cc5fde77b30228669406980ce8ada..2566fc82e0ddc1663bbc300a15c94bae16969399 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: ipcp.c,v 1.16 1995/04/26 06:46:50 paulus Exp $";
+static char rcsid[] = "$Id: ipcp.c,v 1.21 1995/08/17 11:57:12 paulus Exp $";
 #endif
 
 /*
@@ -149,6 +149,13 @@ ipcp_init(unit)
     ao->neg_vj = 1;
     ao->maxslotindex = MAX_STATES - 1;
     ao->cflag = 1;
+
+    /*
+     * XXX These control whether the user may use the proxyarp
+     * and defaultroute options.
+     */
+    ao->proxy_arp = 1;
+    ao->default_route = 1;
 }
 
 
@@ -575,16 +582,15 @@ 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;
+           if (try.ouraddr != 0)
+               try.neg_addr = 1;
            no.neg_addr = 1;
            break;
-       default:
-           goto bad;
        }
        p = next;
     }
@@ -783,6 +789,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
                 * 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;
            }
 
@@ -843,6 +850,7 @@ ipcp_reqci(f, inp, len, reject_if_disagree)
                 * 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;
            }
        
@@ -886,7 +894,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;