[OpenWrt-Devel] [PATCH] kernel: fix rtcache compilation with 4.19 and NF_CONNTRACK_IPV6

Rafał Miłecki zajec5 at gmail.com
Thu Apr 4 03:31:41 EDT 2019


From: Rafał Miłecki <rafal at milecki.pl>

This fixes:
net/netfilter/nf_conntrack_rtcache.c: In function 'nf_rtcache_get_cookie':
net/netfilter/nf_conntrack_rtcache.c:82:11: error: 'const struct rt6_info' has no member named 'rt6i_node'; did you mean 'rt6i_idev'?
   if (rt->rt6i_node)
           ^~~~~~~~~
           rt6i_idev

IPv6 structs were reworked in upstream kernel by:
commit a64efe142f5e ("net/ipv6: introduce fib6_info struct and helpers")
commit 77634cc67dc1 ("net/ipv6: Remove unused code and variables for rt6_info")
commit 93c2fb253d17 ("net/ipv6: Rename fib6_info struct elements")

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
Similar case was handled in the upstream commit 93531c674315 ("net/ipv6:
separate handling of FIB entries from dst based routes") which replaced:
fn = rcu_dereference(rt->rt6i_node);
with "if (rt->from)" check and:
fn = rcu_dereference(rt->from->rt6i_node);

So I assume it's how we have to modify rtcache.
---
 .../backport-4.19/020-backport_netfilter_rtcache.patch        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch b/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch
index 32b43082be..3a35381ce3 100644
--- a/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch
+++ b/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch
@@ -209,8 +209,8 @@ Signed-off-by: Florian Westphal <fw at strlen.de>
 +	if (pf == NFPROTO_IPV6) {
 +		const struct rt6_info *rt = (const struct rt6_info *)dst;
 +
-+		if (rt->rt6i_node)
-+			return (u32)rt->rt6i_node->fn_sernum;
++		if (rt->from && rt->from->fib6_node)
++			return (u32)rt->from->fib6_node->fn_sernum;
 +	}
 +#endif
 +	return 0;
-- 
2.21.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list