]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/ipcp.c
pppd: Fix enforcing peer IP address (#235)
[ppp.git] / pppd / ipcp.c
index 24452bff59efd9bec246551b6bae1f9791916a8a..fcf17b1e7472dcb4bc8c07c0b73827daf1e92c5f 100644 (file)
@@ -1760,6 +1760,12 @@ ipcp_up(fsm *f)
     /*
      * We must have a non-zero IP address for both ends of the link.
      */
+
+    if (wo->hisaddr && !wo->accept_remote && (!(ho->neg_addr || ho->old_addrs) || ho->hisaddr != wo->hisaddr)) {
+       error("Peer refused to agree to his IP address");
+       ipcp_close(f->unit, "Refused his IP address");
+       return;
+    }
     if (!ho->neg_addr && !ho->old_addrs)
        ho->hisaddr = wo->hisaddr;