[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#941026: netcfg_gateway_reachable wrongly rejects IPv6 link-local addresses



On 2019-09-23 18:00, Andrew Kanaber wrote:
When doing static IP configuration, netcfg will reject a gateway address outside the host's network as defined by the netmask. This is wrong for IPv6 because the gateway can legitimately be a link-local address in fe80::/64 instead of the host's network range. Ubuntu have fixed this bug in their
version, see LP#1382295
https://bugs.launchpad.net/ubuntu/+source/netcfg/+bug/1382295

The relevant function is netcfg_gateway_reachable in netcfg-common.c which simply checks gateway_address & netmask == host_address. It should also allow
IPv6 addresses in the link local prefix fe80::/64.

Less importantly, the error message it triggers could be a bit clearer, "The gateway address you entered is unreachable" sounds like it might be a network
error when it's purely a user-input parsing rejection - if the code had
actually tried the link-local address it would've worked.

So how does it identify the interface to use in this case? Does the kernel have special support to pick the correct one if there is only one non-loopback interface? Generally link-local addresses do need to be qualified with the interface to be used.

Kind regards
Philipp Kern


Reply to: