When querying for the device IPv6 address, ignore link local addresses. Those
addresses should not be used for tunnel communications anyway.
(X)->s6_addr[10] == 0xff && \
(X)->s6_addr[11] == 0xff)
+#define IN6_IS_ADDR_LINKLOCAL(X) \
+ (((X)->s6_addr[0] == 0xfe) && \
+ (((X)->s6_addr[1] & 0xc0) == 0x80))
+
#define INET_ADDRSTRLEN 16
#define INET6_ADDRSTRLEN 46
struct in6_addr in6_tmp;
char ifname[16 + 1];
if (parse_if_inet6_line(line, &in6_tmp, ifname)
- && !strcmp(name, ifname))
+ && !strcmp(name, ifname)
+ && !IN6_IS_ADDR_LINKLOCAL(&in6_tmp))
{
netdev->in6 = in6_tmp;
netdev->in6_error = 0;