Files
dnsmasq/src
Beniamino Galvani 770bce967c Fix parsing of IPv6 addresses with peer from netlink.
In the most common case, an IPv6 address doesn't have a peer and the
IFA_ADDRESS netlink attribute contains the address itself.

But if the address has a peer (typically for point to point links),
then IFA_ADDRESS contains the peer address and IFA_LOCAL contains the
address [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/addrconf.c?h=v5.17#n5030

Fix the parsing of IPv6 addresses with peers, as currently dnsmasq
unsuccessfully tries to bind on the peer address.

A simple reproducer is:

  dnsmasq --conf-file=/dev/null -i dummy1 -d --bind-dynamic &
  sleep 2
  ip link add dummy1 type dummy
  ip link set dummy1 up
  ip addr add dev dummy1 fd01::1/64 peer fd01::2/64
  ip addr add dev dummy1 fd01::42/64
  sleep 2
  ss -lnp | grep dnsmasq | grep fd01

Before the patch:
  dnsmasq: failed to create listening socket for fd01::2: Cannot assign requested address
  dnsmasq: failed to create listening socket for fd01::2: Cannot assign requested address
  udp   UNCONN 0   [fd01::42]:53   [::]:*    users:(("dnsmasq",pid=23947,fd=14))
  tcp   LISTEN 0   [fd01::42]:53   [::]:*    users:(("dnsmasq",pid=23947,fd=15

After:
  udp   UNCONN 0   [fd01::42]:53   [::]:*    users:(("dnsmasq",pid=23973,fd=16))
  udp   UNCONN 0    [fd01::1]:53   [::]:*    users:(("dnsmasq",pid=23973,fd=14))
  tcp   LISTEN 0   [fd01::42]:53   [::]:*    users:(("dnsmasq",pid=23973,fd=17))
  tcp   LISTEN 0    [fd01::1]:53   [::]:*    users:(("dnsmasq",pid=23973,fd=15))
2022-05-27 21:16:18 +01:00
..
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-02-02 18:28:27 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-05-26 14:49:10 +01:00
2022-01-24 15:19:00 +00:00
2022-01-30 00:42:46 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00
2021-03-28 00:58:54 +00:00
2022-01-24 15:19:00 +00:00
2022-01-24 15:19:00 +00:00