Skip to contentSkip to conversation

gre: Revert IPv6 link-local address fix.

PATCH Applied Guillaume Nault 4 participants 6 messages Mar 19, 2025 – Mar 20, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover gre: Revert IPv6 link-local address fix.

Following Paolo's suggestion, let's revert the IPv6 link-local address generation fix for GRE devices. The patch introduced regressions in the upstream CI, which are still under investigation.

Start by reverting the kselftest that depend on that fix (patch 1), then revert the kernel code itself (patch 2).

Guillaume Nault (2):
Revert "selftests: Add IPv6 link-local address generation tests for
GRE devices."
Revert "gre: Fix IPv6 link-local address generation."

 net/ipv6/addrconf.c                           |  15 +-
 tools/testing/selftests/net/Makefile          |   1 -
 .../testing/selftests/net/gre_ipv6_lladdr.sh  | 177 ------------------
 3 files changed, 6 insertions(+), 187 deletions(-)
 delete mode 100755 tools/testing/selftests/net/gre_ipv6_lladdr.sh
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/2 Revert "selftests: Add IPv6 link-local address generation tests for GRE devices."

This reverts commit 6f50175ccad4278ed3a9394c00b797b75441bd6e.

Commit 183185a18ff9 ("gre: Fix IPv6 link-local address generation.") is going to be reverted. So let's revert the corresponding kselftest first.

---
 tools/testing/selftests/net/Makefile          |   1 -
 .../testing/selftests/net/gre_ipv6_lladdr.sh  | 177 ------------------
 2 files changed, 178 deletions(-)
 delete mode 100755 tools/testing/selftests/net/gre_ipv6_lladdr.sh
tools/testing/selftests/net/Makefile +0 -1
index 5916f3b81c39..73ee88d6b043 100644
@@ -31,7 +31,6 @@ TEST_PROGS += veth.sh
 TEST_PROGS += ioam6.sh
 TEST_PROGS += gro.sh
 TEST_PROGS += gre_gso.sh
-TEST_PROGS += gre_ipv6_lladdr.sh
 TEST_PROGS += cmsg_so_mark.sh
 TEST_PROGS += cmsg_so_priority.sh
 TEST_PROGS += cmsg_time.sh cmsg_ipv6.sh
tools/testing/selftests/net/gre_ipv6_lladdr.sh deleted +0 -177

177 lines not on this page · raw message

Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/2 Revert "gre: Fix IPv6 link-local address generation."

In reply to Guillaume Nault

This reverts commit 183185a18ff96751db52a46ccf93fff3a1f42815.

This patch broke net/forwarding/ip6gre_custom_multipath_hash.sh in some circumstances (https://lore.kernel.org/netdev/Z9RIyKZDNoka53EO@mini-arch/).
Let's revert it while the problem is being investigated.

Fixes 183185a18ff9 ("gre: Fix IPv6 link-local address generation.")
---
 net/ipv6/addrconf.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
net/ipv6/addrconf.c +6 -9
index 8b6258819dad..ac8cc1076536 100644
@@ -3209,13 +3209,16 @@ static void add_v4_addrs(struct inet6_dev *idev)
 	struct in6_addr addr;
 	struct net_device *dev;
 	struct net *net = dev_net(idev->dev);
-	int scope, plen;
+	int scope, plen, offset = 0;
 	u32 pflags = 0;
 
 	ASSERT_RTNL();
 
 	memset(&addr, 0, sizeof(struct in6_addr));
-	memcpy(&addr.s6_addr32[3], idev->dev->dev_addr, 4);
+	/* in case of IP6GRE the dev_addr is an IPv6 and therefore we use only the last 4 bytes */
+	if (idev->dev->addr_len == sizeof(struct in6_addr))
+		offset = sizeof(struct in6_addr) - 4;
+	memcpy(&addr.s6_addr32[3], idev->dev->dev_addr + offset, 4);
 
 	if (!(idev->dev->flags & IFF_POINTOPOINT) && idev->dev->type == ARPHRD_SIT) {
 		scope = IPV6_ADDR_COMPATv4;
@@ -3526,13 +3529,7 @@ static void addrconf_gre_config(struct net_device *dev)
 		return;
 	}
 
-	/* Generate the IPv6 link-local address using addrconf_addr_gen(),
-	 * unless we have an IPv4 GRE device not bound to an IP address and
-	 * which is in EUI64 mode (as __ipv6_isatap_ifid() would fail in this
-	 * case). Such devices fall back to add_v4_addrs() instead.
-	 */
-	if (!(dev->type == ARPHRD_IPGRE && *(__be32 *)dev->dev_addr == 0 &&
-	      idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64)) {
+	if (dev->type == ARPHRD_ETHER) {
 		addrconf_addr_gen(idev, true);
 		return;
 	}
Signature · 1 line
2.39.2
Acked-by on the v1 series
#3 lore raw
In reply to Guillaume Nault
Quoted 6 lines · Guillaume Nault

Following Paolo's suggestion, let's revert the IPv6 link-local address generation fix for GRE devices. The patch introduced regressions in the upstream CI, which are still under investigation.

Start by reverting the kselftest that depend on that fix (patch 1), then revert the kernel code itself (patch 2).

maintainer
#4 lore raw
In reply to Guillaume Nault
Quoted 12 lines · Guillaume Nault

Following Paolo's suggestion, let's revert the IPv6 link-local address generation fix for GRE devices. The patch introduced regressions in the upstream CI, which are still under investigation.

Start by reverting the kselftest that depend on that fix (patch 1), then revert the kernel code itself (patch 2).

Guillaume Nault (2):
Revert "selftests: Add IPv6 link-local address generation tests for
GRE devices."
Revert "gre: Fix IPv6 link-local address generation."

Quoted 5 lines
 net/ipv6/addrconf.c                           |  15 +-
 tools/testing/selftests/net/Makefile          |   1 -
 .../testing/selftests/net/gre_ipv6_lladdr.sh  | 177 ------------------
 3 files changed, 6 insertions(+), 187 deletions(-)
 delete mode 100755 tools/testing/selftests/net/gre_ipv6_lladdr.sh

I'm going to apply this series well below the 24 grace period, to fit tomorrow's PR.

Any feedback more than welcome, but it need to be fast ;)

Thanks,

Paolo

#5 lore raw
In reply to Guillaume Nault
This series was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Wed, 19 Mar 2025 22:26:39 +0100 you wrote:

Following Paolo's suggestion, let's revert the IPv6 link-local address generation fix for GRE devices. The patch introduced regressions in the upstream CI, which are still under investigation.

Start by reverting the kselftest that depend on that fix (patch 1), then revert the kernel code itself (patch 2).

[...]

Here is the summary with links:
- [net,1/2] Revert "selftests: Add IPv6 link-local address generation tests for GRE devices."

    https://git.kernel.org/netdev/net/c/355d940f4d5a
  - [net,2/2] Revert "gre: Fix IPv6 link-local address generation."
    https://git.kernel.org/netdev/net/c/fc486c2d060f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html