Skip to contentSkip to conversation

ipmr: Do not define MAXVIFS twice

PATCH Applied David Ahern 3 participants 3 messages May 2, 2019 – May 4, 2019

Subsystems (3)
lore
Share & tools
lore

David Ahern

author maintainer
#0 lore raw

PATCH 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
index 34de06b426ef..c5a389f81e91 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · David Ahern

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 -0
index 34de06b426ef..c5a389f81e91 100644
@@ -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. :)

maintainer Applied
#2 lore raw
In reply to David Ahern

From: David Ahern <[email protected]>
Date: Thu, 2 May 2019 15:23:26 -0700

Quoted 8 lines

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.

Quoted 4 lines

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.

Applied.