]> git.ozlabs.org Git - ppp.git/commit
ipv6cp: Fix ipv6cp-accept-local and ipv6cp-accept-remote options (#282)
authorpali <7141871+pali@users.noreply.github.com>
Sat, 19 Jun 2021 01:02:37 +0000 (03:02 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Jun 2021 01:02:37 +0000 (11:02 +1000)
commit5b7ca16d695affb207aa9d619f7393b66d246de8
tree1c72da830540a350e55f558a4c2d58d44718f30e
parent36099775a4e40a7a7b85191486db284fa0e8338f
ipv6cp: Fix ipv6cp-accept-local and ipv6cp-accept-remote options (#282)

These options are completely broken and ignored because pppd reflects these
options in the incorrect struct ipv6cp_allowoptions. Instead pppd expects
that these options are reflected in struct ipv6cp_wantoptions. Same applies
also for IPv4 code where these options are reflected in struct wantoptions.

This issue can be tested and verified by following command:

    ./pppd noauth asyncmap 0 default-asyncmap novj noaccomp nopcomp nodeflate nobsdcomp nomagic  local nolock nodetach  noip  ipv6 ::2,::1 ipv6cp-accept-local ipv6cp-accept-remote  debug pty "./pppd noauth asyncmap 0 default-asyncmap novj noaccomp nopcomp nodeflate nobsdcomp nomagic  local nolock nodetach  noip  ipv6 ::1:1,::1:2  notty"

First pppd prefer to use IPv6 addresses ::2 and ::1 but accept also any
address suggested by second pppd. Second pppd allows usage only of IPv6
addresses ::1:1 and ::1:2 and does not accept any suggestion by first pppd.

Without this patch first pppd show this output:

    sent [IPV6CP ConfReq id=0x1 <addr fe80::0000:0000:0000:0002>]
    rcvd [IPV6CP ConfReq id=0x1 <addr fe80::0000:0000:0001:0001>]
    sent [IPV6CP ConfNak id=0x1 <addr fe80::0000:0000:0000:0001>]
    rcvd [IPV6CP ConfNak id=0x1 <addr fe80::0000:0000:0001:0002>]
    sent [IPV6CP ConfReq id=0x2 <addr fe80::0000:0000:0000:0002>]
    rcvd [IPV6CP ConfReq id=0x2 <addr fe80::0000:0000:0001:0001>]
    sent [IPV6CP ConfAck id=0x2 <addr fe80::0000:0000:0001:0001>]
    rcvd [IPV6CP ConfAck id=0x2 <addr fe80::0000:0000:0000:0002>]
    local  LL address fe80::0000:0000:0000:0002
    remote LL address fe80::0000:0000:0001:0001

Which means that second pppd did not forced its IPv6 address assignment.

With applying this patch first pppd show output:

    sent [IPV6CP ConfReq id=0x1 <addr fe80::0000:0000:0000:0002>]
    rcvd [IPV6CP ConfReq id=0x1 <addr fe80::0000:0000:0001:0001>]
    sent [IPV6CP ConfAck id=0x1 <addr fe80::0000:0000:0001:0001>]
    rcvd [IPV6CP ConfNak id=0x1 <addr fe80::0000:0000:0001:0002>]
    sent [IPV6CP ConfReq id=0x2 <addr fe80::0000:0000:0001:0002>]
    rcvd [IPV6CP ConfAck id=0x2 <addr fe80::0000:0000:0001:0002>]
    local  LL address fe80::0000:0000:0001:0002
    remote LL address fe80::0000:0000:0001:0001

And now first pppd accepted offer from second pppd, meaning that both
ipv6cp-accept-local and ipv6cp-accept-remote are working.

Signed-off-by: Pali Rohár <pali@kernel.org>
pppd/ipv6cp.c