Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFA_ADDRESS and IFA_LOCAL confusion for dhcpv6 over ppp? #201

Closed
jon-y opened this issue May 7, 2023 · 4 comments
Closed

IFA_ADDRESS and IFA_LOCAL confusion for dhcpv6 over ppp? #201

jon-y opened this issue May 7, 2023 · 4 comments
Labels

Comments

@jon-y
Copy link

jon-y commented May 7, 2023

I am using dhcpv6 over PPP (yes my ISP is weird), I am on Gentoo Linux, and this issue is only happening with dhcp-10.x, the older 9.4.1 and 9.5.0 were fine where I am able to get an IPv6 address normally over ppp.

_if_addrflags6 seems to complain about ppp ipv6 addresses, causing the following message:
if_learnaddrs: if_addrflags6: fe80::XXXX%ppp0: No such process

I do not get any ipv6 addresses from my ISP after that.

If I acquire the ipv6 address with dhcpcd-9, and rerun dhcpcd-10 with a dummy IFA_LOCAL in the case/switch in _if_addrflags6, it don't seem to fix the issue, causing a different message to be emitted:
if_learnaddrs: if_addrflags6: 2001:XXXX%ppp0: No such process

Possibly related to the change in 064767e.

For the record, ip a output is:

6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1460 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp 
    inet 202.XXX.XXX.XXX.XXX peer 202.XXX.XXX.XXX/32 scope global ppp0
       valid_lft forever preferred_lft forever
    inet6 2001:XXXXX/128 scope global dynamic noprefixroute 
       valid_lft 259199sec preferred_lft 172799sec
    inet6 fe80::XXXXX peer fe80::XXXXX/128 scope link 
       valid_lft forever preferred_lft forever
rsmarples added a commit that referenced this issue May 8, 2023
PPP interfaces use IFA_LOCAL as the local address and IFA_ADDRESS
as the destination address
Non PPP interfaces use IFA_ADDRESS as the local address.
Confusing yes?

Anwyay, this should fix #201 and #149.
@rsmarples
Copy link
Member

@jon-y thanks for the heads up about ifa confusion with ppp interfaces. The above commit should fix - can you test it please? I don't have any PPP interfaces here that I can replicate with atm.

@rsmarples rsmarples added the bug label May 8, 2023
@jon-y
Copy link
Author

jon-y commented May 8, 2023

Looks like the warning is still there (this is after exiting 9.x and rebinding with 10.x):

dhcpcd-10.0.1 starting                                                                                                                                                                                                                          
udev: starting                                                                                                                                                                                                                                  
dev: loaded udev                                                                                                                                                                                                                                
spawned privileged proxy on PID 5615                                                                                                                                                                                                            
spawned network proxy on PID 5616                                                                                                                                                                                                               
spawned controller proxy on PID 5617                                                                                                                                                                                                            
DUID 00:01:03:04:2b:ea:78:c4:00:00:00:00:00:00                                                                                                                                                                                                  
sandbox: seccomp                                                                                                                                                                                                                                
if_learnaddrs: if_addrflags6: 2001:XXXX:XXXX::XXXX%ppp0: No such process                                                                                                                                                                         
ppp0: executing: /libexec/dhcpcd-run-hooks PREINIT                                                                                                                                                   
ppp0: executing: /libexec/dhcpcd-run-hooks CARRIER                                                                                                                                                   
ppp0: IAID 70:70:70:30                                                                                                                                                                                                                          
ppp0: delaying IPv6 router solicitation for 1.0 seconds                                                                                                                                                                                         
ppp0: using static address 202.XXXX.XXXX.XXXX/32                                                                                                                                                                                                   
ppp0: adding IP address 202.XXXX.XXXX.XXXX/32 destination 202.XXXX.XXXX.XXXX                                                                                                                                                                             
ppp0: executing: /libexec/dhcpcd-run-hooks STATIC                                                                                                                                                    
ppp0: executing: /libexec/dhcpcd-run-hooks STATIC                                                                                                                                                    
ppp0: soliciting an IPv6 router                                                                                                                                                                                                                 
ppp0: sending Router Solicitation                                                                                                                                                                                                               
ppp0: Router Advertisement from fe80::XXXX:XXXX:XXXX:XXXX                                                                                                                                                                                         
ppp0: adding default route via fe80::XXXX:XXXX:XXXX:XXXX                                                                                                                                                                                          
ppp0: executing: /libexec/dhcpcd-run-hooks ROUTERADVERT                                                                                                                                              
ppp0: reading lease: /var/db/dhcpcd/ppp0.lease6                                                                                                                                                                                                 
ppp0: soliciting a DHCPv6 lease                                                                                                                                                                                                                 
ppp0: delaying SOLICIT6 (xid 0xb1d2e5), next in 2.1 seconds                                                                                                                                                                                     
ppp0: multicasting SOLICIT6 (xid 0xb1d2e5), next in 1.0 seconds                                                                                                                                                                                 
ppp0: multicasting SOLICIT6 (xid 0xb1d2e5), next in 2.2 seconds                                                                                                                                                                                 
ppp0: multicasting SOLICIT6 (xid 0xb1d2e5), next in 4.1 seconds                                                                                                                                                                                 
ppp0: multicasting SOLICIT6 (xid 0xb1d2e5), next in 8.1 seconds                                                                                                                                                                                 
ppp0: multicasting SOLICIT6 (xid 0xb1d2e5), next in 16.7 seconds                                             

Compared to the previous 9.x rebinding:

dhcpcd-9.5.0 starting                                                                                                                                                                                                                           
udev: starting                                                                                                                                                                                                                                  
dev: loaded udev
spawned privileged proxy on PID 7712
spawned network proxy on PID 7713
spawned controller proxy on PID 7714
DUID 00:01:00:01:1d:e9:74:1c:b6:5f:7a:bd:21:78
sandbox: seccomp
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks PREINIT
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks CARRIER
ppp0: IAID 70:70:70:30
ppp0: IA type 3 IAID 00:00:00:01
ppp0: IA type 25 IAID 00:00:00:02
ppp0: delaying IPv6 router solicitation for 0.9 seconds
ppp0: reading lease: /var/lib/dhcpcd/ppp0.lease6
ppp0: rebinding prior DHCPv6 lease
ppp0: delaying REBIND6 (xid 0x255f2c), next in 2.1 seconds
ethlan0: activating for delegation
ethlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks PREINIT
ethlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks CARRIER
ethlan0: IAID 3f:d4:be:9d
ppp0: using static address 202.XXXX.XXXX.XXXX/32
ppp0: adding IP address 202.XXXX.XXXX.XXXX/32 destination 202.XXXX.XXXX.XXXX
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks STATIC
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks STATIC
ppp0: soliciting an IPv6 router
ppp0: sending Router Solicitation
ppp0: Router Advertisement from fe80::XXXX:XXXX:XXXX:XXXX
ppp0: adding default route via fe80::XXXX:XXXX:XXXX:XXXX
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks ROUTERADVERT
ppp0: multicasting REBIND6 (xid 0x255f2c), next in 1.0 seconds
ppp0: REPLY6 received from fe80::XXXX:XXXX:XXXX:XXXX
ppp0: adding address 2001:XXXX:XXXX::XXXX/128
ppp0: pltime 172800 seconds, vltime 259200 seconds
ppp0: sending NA for 2001:XXXX:XXXX::XXXX/128
ppp0: renew in 86400, rebind in 138240, expire in 259200 seconds
lo: adding reject route to 2001:XXXX:XXXX:XXXX::/64
ppp0: writing lease: /var/lib/dhcpcd/ppp0.lease6
ppp0: delegated prefix 2001:XXXX:XXXX:XXXX::/64
ethlan0: adding address 2001:XXXX:XXXX:XXXX::1/64
ethlan0: pltime 172800 seconds, vltime 259200 seconds
ethlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks DELEGATED6
ethlan0: adding route to 2001:XXXX:XXXX:XXXX::/64
lo: deleting reject route to 2001:XXXX:XXXX:XXXX::/64
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks REBIND6
ppp0: sending NA for 2001:XXXX:XXXX::XXXX/128
ppp0: sending NA for 2001:XXXX:XXXX::XXXX/128
^Creceived SIGINT, stopping
ppp0: removing interface
ppp0: executing: /lib/dhcpcd/dhcpcd-run-hooks STOPPED
ethlan0: removing interface
ethlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks STOPPED

rsmarples added a commit that referenced this issue May 17, 2023
Rather than matching addresses during netlink message processing,
extract the local, address and flag parts.
Once done, then match local and address to the address we are
looking for and if equal apply the flags.

Should really fix #201 and maybe #149.
@rsmarples
Copy link
Member

OK, This new patch should fix it! I finally got around to testing it.
Can you verify it works please?

@jon-y
Copy link
Author

jon-y commented May 17, 2023

Looks good so far, it is able to acquire an ipv6 address. Thanks for the fix, I'll continue monitoring and see if I notice any weird behaviors,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants