ipmr: Do not define MAXVIFS twice
Subsystems (3)
David Ahern
maintainerPATCH 1/1 ipmr: Do not define MAXVIFS twice
From: David Ahern <[email protected]>
b70432f7319eb refactored mroute code to make it common between ipv4 and ipv6. In the process, MAXVIFS got defined a second time: the first is in the uapi file linux/mroute.h. A second one was created presumably for IPv6 but it is not needed. Remove it and have mroute_base.h include the uapi file directly since it is shared.
include/linux/mroute.h can not be included in mroute_base.h because it contains a reference to mr_mfc which is defined in mroute_base.h.
--- include/linux/mroute_base.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
include/linux/mroute_base.h +1 -7
@@ -4,6 +4,7 @@#include <linux/netdevice.h> #include <linux/rhashtable-types.h> #include <linux/spinlock.h> +#include <uapi/linux/mroute.h> #include <net/net_namespace.h> #include <net/sock.h> #include <net/fib_notifier.h>
@@ -90,13 +91,6 @@ static inline int mr_call_vif_notifiers(struct net *net,return call_fib_notifiers (net, event_type, &info.info); } -#ifndef MAXVIFS -/* This one is nasty; value is defined in uapi using different symbols for -* mroute and morute6 but both map into same 32. -*/ -#define MAXVIFS 32 -#endif -#define VIF_EXISTS (_mrt, _idx) (!!((_mrt)->vif_table[_idx].dev))/* mfc_flags:
Signature · 1 line
2.11.0
Quoted 33 lines · David Ahern
From: David Ahern <[email protected]>
b70432f7319ebrefactored mroute code to make it common between ipv4 and ipv6. In the process, MAXVIFS got defined a second time: the first is in the uapi filelinux/mroute.h. A second one was created presumably for IPv6 but it is not needed. Remove it and havemroute_base.hinclude the uapi file directly since it is shared.
include/linux/mroute.hcan not be included inmroute_base.hbecause it contains a reference tomr_mfcwhich is defined inmroute_base.h.Signed-off-by David Ahern <[email protected]>--- include/linux/mroute_base.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)include/linux/mroute_base.h +1
-0@@ -4,6 +4,7 @@#include <linux/netdevice.h> #include <linux/rhashtable-types.h> #include <linux/spinlock.h> +#include <uapi/linux/mroute.h> #include <net/net_namespace.h> #include <net/sock.h> #include <net/fib_notifier.h> @@ -90,13 +91,6 @@ static inline int mr_call_vif_notifiers(struct net *net,return call_fib_notifiers (net, event_type, &info.info); }
include/linux/mroute_base.h static inline int mr_call_vif_notifiers(struct net *net, · line 96
Quoted 10 lines
include/linux/mroute_base.h +0
-7-#ifndef MAXVIFS -/* This one is nasty; value is defined in uapi using different symbols for -* mroute and morute6 but both map into same 32. -*/ -#define MAXVIFS 32 -#endif -#define VIF_EXISTS (_mrt, _idx) (!!((_mrt)->vif_table[_idx].dev))/* mfc_flags:
It's in fact a mess, ipv6 defines MAXMIFS (notice the *M*) which must match MAX*V*IFS due to the MAXVIFS use in ipmr_base for one (possibly other places too).. Maybe this value should be set on initialization per family in the future because if it gets out of sync between v4 and v6 bad things will follow. :)
From: David Ahern <[email protected]>
Date: Thu, 2 May 2019 15:23:26 -0700
Quoted 8 lines
From: David Ahern <[email protected]>
b70432f7319ebrefactored mroute code to make it common between ipv4 and ipv6. In the process, MAXVIFS got defined a second time: the first is in the uapi filelinux/mroute.h. A second one was created presumably for IPv6 but it is not needed. Remove it and havemroute_base.hinclude the uapi file directly since it is shared.
Quoted 4 lines
include/linux/mroute.hcan not be included inmroute_base.hbecause it contains a reference tomr_mfcwhich is defined inmroute_base.h.Signed-off-by David Ahern <[email protected]>
Applied.