Skip to content

Commit 30e2291

Browse files
thomasjwinterkuba-moo
authored andcommitted
ip/ip6_gre: Fix non-point-to-point tunnel not generating IPv6 link local address
We recently found that our non-point-to-point tunnels were not generating any IPv6 link local address and instead generating an IPv6 compat address, breaking IPv6 communication on the tunnel. Previously, addrconf_gre_config always would call addrconf_addr_gen and generate a EUI64 link local address for the tunnel. Then commit e5dd729 changed the code path so that add_v4_addrs is called but this only generates a compat IPv6 address for non-point-to-point tunnels. I assume the compat address is specifically for SIT tunnels so have kept that only for SIT - GRE tunnels now always generate link local addresses. Fixes: e5dd729 ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address") Signed-off-by: Thomas Winter <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 23ca0c2 commit 30e2291

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/ipv6/addrconf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,17 +3127,17 @@ static void add_v4_addrs(struct inet6_dev *idev)
31273127
offset = sizeof(struct in6_addr) - 4;
31283128
memcpy(&addr.s6_addr32[3], idev->dev->dev_addr + offset, 4);
31293129

3130-
if (idev->dev->flags&IFF_POINTOPOINT) {
3130+
if (!(idev->dev->flags & IFF_POINTOPOINT) && idev->dev->type == ARPHRD_SIT) {
3131+
scope = IPV6_ADDR_COMPATv4;
3132+
plen = 96;
3133+
pflags |= RTF_NONEXTHOP;
3134+
} else {
31313135
if (idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_NONE)
31323136
return;
31333137

31343138
addr.s6_addr32[0] = htonl(0xfe800000);
31353139
scope = IFA_LINK;
31363140
plen = 64;
3137-
} else {
3138-
scope = IPV6_ADDR_COMPATv4;
3139-
plen = 96;
3140-
pflags |= RTF_NONEXTHOP;
31413141
}
31423142

31433143
if (addr.s6_addr32[3]) {

0 commit comments

Comments
 (0)