]> git.ozlabs.org Git - ppp.git/commitdiff
Merge pull request #145 from sthibaul/ipv6cp-accept-remote
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 7 Aug 2020 00:44:01 +0000 (10:44 +1000)
committerGitHub <noreply@github.com>
Fri, 7 Aug 2020 00:44:01 +0000 (10:44 +1000)
Add ipv6cp-accept-remote option

pppd/ipv6cp.c
pppd/ipv6cp.h
pppd/pppd.8

index bda91e90afb0b38ca303c666393deec19756e223..58573363ea8d9b9c6b0145118d97c4798b65bf18 100644 (file)
@@ -245,6 +245,8 @@ static option_t ipv6cp_option_list[] = {
 
     { "ipv6cp-accept-local", o_bool, &ipv6cp_allowoptions[0].accept_local,
       "Accept peer's interface identifier for us", 1 },
+    { "ipv6cp-accept-remote", o_bool, &ipv6cp_allowoptions[0].accept_remote,
+      "Accept peer's interface identifier for itself", 1 },
 
     { "defaultroute6", o_bool, &ipv6cp_wantoptions[0].default_route,
       "Add default IPv6 route", OPT_ENABLE|1, &ipv6cp_allowoptions[0].default_route },
@@ -443,7 +445,8 @@ ipv6cp_init(unit)
     memset(wo, 0, sizeof(*wo));
     memset(ao, 0, sizeof(*ao));
 
-    wo->accept_local = 1;
+    wo->accept_local = 0;
+    wo->accept_remote = 0;
     wo->neg_ifaceid = 1;
     ao->neg_ifaceid = 1;
 
@@ -544,8 +547,11 @@ ipv6cp_resetci(f)
     wo->req_ifaceid = wo->neg_ifaceid && ipv6cp_allowoptions[f->unit].neg_ifaceid;
     
     if (!wo->opt_local) {
+       wo->accept_local = 1;
        eui64_magic_nz(wo->ourid);
     }
+    if (!wo->opt_remote)
+       wo->accept_remote = 1;
     
     *go = *wo;
     eui64_zero(go->hisid);     /* last proposed interface identifier */
@@ -973,7 +979,7 @@ ipv6cp_reqci(f, inp, len, reject_if_disagree)
                orc = CONFREJ;          /* Reject CI */
                break;
            }
-           if (!eui64_iszero(wo->hisid) && 
+           if (!eui64_iszero(wo->hisid) && !wo->accept_remote &&
                !eui64_equals(ifaceid, wo->hisid) && 
                eui64_iszero(go->hisid)) {
                    
index 25235d27fd2313e202a8817fe48b58cf0128e1b6..3eb7b2a77cf805f309561aade049379aa8d64afc 100644 (file)
@@ -151,7 +151,8 @@ typedef struct ipv6cp_options {
     int neg_ifaceid;           /* Negotiate interface identifier? */
     int req_ifaceid;           /* Ask peer to send interface identifier? */
     int default_route;         /* Assign default route through interface? */
-    int accept_local;          /* accept peer's value for iface id? */
+    int accept_local;          /* accept peer's value for our iface id? */
+    int accept_remote;         /* accept peer's value for his iface id? */
     int opt_local;             /* ourtoken set by option */
     int opt_remote;            /* histoken set by option */
     int use_ip;                        /* use IP as interface identifier */
index 2517446a7acc78d6f7d9f9c079643b219d57d674..1cf0f67db62b181f584903a52eafd8b3aafa45fe 100644 (file)
@@ -470,6 +470,11 @@ With this option, pppd will accept the peer's idea of our local IPv6
 interface identifier, even if the local IPv6 interface identifier
 was specified in an option.
 .TP
+.B ipv6cp\-accept\-remote
+With this option, pppd will accept the peer's idea of its (remote)
+IPv6 interface identifier, even if the remote IPv6 interface
+identifier was specified in an option.
+.TP
 .B ipv6cp\-max\-configure \fIn
 Set the maximum number of IPv6CP configure-request transmissions to
 \fIn\fR (default 10).