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

FS#3657 - dnsmasq listen on the wrong address after the PPP update #8692

Open
openwrt-bot opened this issue Mar 3, 2021 · 18 comments
Open
Labels

Comments

@openwrt-bot
Copy link

castiel652:

With PPP version 2.4.9 dnsmasq would try to listen on remote LL address instead of local LL address which spams the log with
daemon.warn dnsmasq[4528]: failed to create listening socket for xxx::xx:xx:xxx:xxx%pppoe-wan: Address not available

That doesn't happen anymore after I revert the commit 030bc39

@openwrt-bot
Copy link
Author

jow-:

Can you provide the output of ifstatus wan both before and after reverting the pppd update?

Would also be interesting to modify package/network/services/ppp/files/lib/netifd/ppp6-up in order to dump the $LLLOCAL value passed by pppd to the up script.

@openwrt-bot
Copy link
Author

castiel652:

I can do that when I get home.

Where and what should I modify in the script?

@openwrt-bot
Copy link
Author

jow-:

Something like "logger -t debug "LLLOCAL=$LLLOCAL" near the top should suffice. You should see a corresponding line in logread then after ifdown/ifup wan

@openwrt-bot
Copy link
Author

castiel652:

This is one is the output of "ifstatus wan" before reverting the commit and I attached the output of LLLOCAL at the top

@openwrt-bot
Copy link
Author

castiel652:

After reverting the commit

@openwrt-bot
Copy link
Author

castiel652:

LLLOCAL is the same as the ipv6-address in the output for both

@openwrt-bot
Copy link
Author

jow-:

And in the broken case, LLLOCAL contains the remote LL address and not the local one?

@openwrt-bot
Copy link
Author

castiel652:

LLLOCAL contains the local one in the broken case

@openwrt-bot
Copy link
Author

slh:

I've updated package/network/services/ppp to current upstream/ HEAD (a4781b380161f44032af5442c0c12dc68413504c), which -among a number of other IPv6 related changes- also contains the patch discussed at ppp-project/ppp#257 (comment), this new version (trivial rebase of 200-makefile.patch needed) seems to avoid the problem.

Edit: While it took considerably longer to trigger, this didn't actually avoid the issue in the end:

root@bthub5:# logread | grep "dnsmasq.*failed to create listening socket for" | wc -l
86
root@bthub5:
# uptime
05:19:22 up 1:06, load average: 0.14, 0.18, 0.23

@openwrt-bot
Copy link
Author

castiel652:

I did the same and still having the same problem

@openwrt-bot
Copy link
Author

castiel652:

Could it possibly be this commit? [[https://github.com/ppp-project/ppp/commit/c3af52231184ade3cf728ec60c9de9e87c2622ad]]

dnsmasq starting to listen on it because it's now correctly set.

EDIT: that's not the problem

@openwrt-bot
Copy link
Author

castiel652:

Sun Mar 21 14:47:21 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 14:47:21 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 14:52:03 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 14:52:03 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 14:56:31 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 14:56:31 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 15:01:06 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 15:01:06 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 15:06:00 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available Sun Mar 21 15:06:00 2021 daemon.warn dnsmasq[9758]: failed to create listening socket for RRLOCAL%pppoe-wan: Address not available

@openwrt-bot
Copy link
Author

castiel652:

root@openwrt:~# cat /etc/config/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fdf2:dd6b:7151::/48'

config interface 'lan'
option type 'bridge'
option ifname 'lan1 lan2 lan3 lan4'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '64'

config interface 'wan'
option ifname 'wan'
option proto 'pppoe'
option username ''
option password ''

config device
option name 'br-lan'
option igmp_snooping '1'
option multicast_querier '0'

root@openwrt:~# cat /etc/config/dhcp

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option ra_management '0'
option ra_default '1'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'

@openwrt-bot
Copy link
Author

castiel652:

I did something wrong when testing the PPP commit.

The problem really is this commit [[https://github.com/ppp-project/ppp/commit/c3af52231184ade3cf728ec60c9de9e87c2622ad]]

@openwrt-bot
Copy link
Author

val-kulkov:

I am observing the same problem. In my case, the error message is:

dnsmasq[24965]: failed to create listening socket for fe80::200:ff:fe00:0%pppoe-wan: Address not available

Here is my configuration (the public IPv6 address has been obfuscated):

root@openwrt:~# ip -6 address show dev pppoe-wan
21: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 state UNKNOWN qlen 3
inet6 2607:deaf:deaf::2f7d/128 scope global dynamic noprefixroute
valid_lft 82271sec preferred_lft 82271sec
inet6 fe80::1d8:5efd:9947:1f55/128 scope link
valid_lft forever preferred_lft forever

root@openwrt:~# ip -6 route show dev pppoe-wan
default from 2607:deaf:deaf::2f7d via fe80::200:ff:fe00:0 dev pppoe-wan metric 512
default from 2607:deaf:dead::/56 via fe80::200:ff:fe00:0 dev pppoe-wan metric 512
fe80::1d8:5efd:9947:1f55 dev pppoe-wan metric 256
fe80::200:ff:fe00:0 dev pppoe-wan metric 256
multicast ff00::/8 dev pppoe-wan metric 256

Note that LLLOCAL is fe80::1d8:5efd:9947:1f55 and RLLOCAL is fe80::200:ff:fe00:0. "ip -6 addr" shows only LLLOCAL, which is correct. I do not understand why "ip -6 route" lists a routing destination for RLLOCAL at all (fe80::200:ff:fe00:0 dev pppoe-wan metric 256), but as long as RLLOCAL is routed to "dev pppoe-wan" it does not create a problem I think.

For some reason, dnsmasq thinks RLLOCAL is a local address and attempts to listen on that address, which apparently cannot succeed. As a workaround, I added "list notinterface 'pppoe-wan'" to the "config dnsmasq" section in /etc/config/dhcp to prevent dnsmasq from listening on pppoe-wan interface. But why RLLOCAL appears as a local address for dnsmasq in the first place?

@openwrt-bot
Copy link
Author

oliver44:

Hello all,

I have the following log in system log and I have seen that for some time it persists in the latest version of OpenWrt protocol PPPoE ipv6 on, does anyone know where the problem is ?

Hostname OpenWrt
Model Linksys WRT1900ACS v2
Architecture ARMv7 Processor rev 1 (v7l)
Target Platform mvebu/cortexa9
Firmware Version OpenWrt SNAPSHOT r18394-962c585580 / LuCI Master git-21.357.58153-63d9bcb
Kernel Version 5.10.87
Mon Dec 27 17:16:58 2021 kern.debug kernel: [ 7789.079910] ieee80211 phy1: Mac80211 start BA ac:e
Mon Dec 27 17:21:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:21:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:26:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:26:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:31:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:31:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:36:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:36:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:41:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:41:20 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:43:18 2021 daemon.warn dnsmasq[8682]: possible DNS-rebind attack detected: dns.msftncsi.com
Mon Dec 27 17:46:21 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:46:21 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:51:21 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Mon Dec 27 17:51:21 2021 daemon.warn dnsmasq[8682]: failed to create listening socket for fe80::1%pppoe-wan: Address not available

Firmware Version OpenWrt SNAPSHOT r18437-92820cc5b9 / LuCI Master git-21.357.58153-63d9bcb
Kernel Version 5.10.88

Tue Dec 28 20:17:04 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:17:04 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:22:04 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:22:04 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:27:04 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:27:04 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:32:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:32:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:37:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:37:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:42:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:42:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:47:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available
Tue Dec 28 20:47:05 2021 daemon.warn dnsmasq[14805]: failed to create listening socket for fe80::1%pppoe-wan: Address not available

@openwrt-bot
Copy link
Author

oliver44:

config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix '29c::/48'
option packet_steering '1'

config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'

config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'

config device
option name 'wan'
option macaddr ''

config interface 'wan'
option device 'wan'
option proto 'pppoe'
option username ''
option password ''
option ipv6 'auto'

config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option confdir '/tmp/dnsmasq.d'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option dhcpv6 'server'

config dhcp 'wan'
option interface 'wan'
option ignore '1'
list ra_flags 'none'

@openwrt-bot
Copy link
Author

oliver44:

root@OpenWrt:# ip -6 address show dev pppoe-wan
23: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq_codel state UNKNOWN group default qlen 3
inet6 2a:80ff:ffff::4f75:f118/128 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::4f75:f118 peer fe80::1/128 scope link
valid_lft forever preferred_lft forever
root@OpenWrt:
# ip -6 route show dev pppoe-wan
default from 2a:5600::/56 via fe80::1 proto static metric 512 pref medium
default from 2a0f:ffff::4f75:f118 via fe80::1 proto static metric 512 pref medium
fe80::1 proto kernel metric 256 pref medium
fe80::4f75:f118 proto kernel metric 256 pref medium
root@OpenWrt:~#

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

1 participant