]> Pileus Git - ~andy/linux/commitdiff
mcast: define and use MRT[6]_MAX in ip[6]_mroute_opt()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Mon, 21 Jan 2013 06:00:25 +0000 (06:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jan 2013 18:55:14 +0000 (13:55 -0500)
This will ease further addition of new MRT[6]_* values and avoid to update
in6.h each time.
Note that we reduce the maximum value from 210 to 209, but 210 does not match
any known value in ip[6]_mroute_setsockopt().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/mroute.h
include/linux/mroute6.h
include/uapi/linux/in6.h
include/uapi/linux/mroute.h
include/uapi/linux/mroute6.h

index ea00d9162ee57c858954e8ec8cd36d4ebf0f15e0..79aaa9fc1a15d6ed7caac2b147ae030b18da060a 100644 (file)
@@ -9,7 +9,7 @@
 #ifdef CONFIG_IP_MROUTE
 static inline int ip_mroute_opt(int opt)
 {
-       return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10);
+       return (opt >= MRT_BASE) && (opt <= MRT_MAX);
 }
 #else
 static inline int ip_mroute_opt(int opt)
index a223561ba12e397e89d23dcd2ed3fd3e4311645a..66982e7640514389098c140a39665f95261071d8 100644 (file)
@@ -10,7 +10,7 @@
 #ifdef CONFIG_IPV6_MROUTE
 static inline int ip6_mroute_opt(int opt)
 {
-       return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10);
+       return (opt >= MRT6_BASE) && (opt <= MRT6_MAX);
 }
 #else
 static inline int ip6_mroute_opt(int opt)
index 5673b97dcf5475f4a6a660828ec1a9f2dd6c712c..53b1d56a6e7f3544b1cd3ec3bcac87b62e630c40 100644 (file)
@@ -259,17 +259,10 @@ struct in6_flowlabel_req {
 
 /*
  * Multicast Routing:
- * see include/linux/mroute6.h.
+ * see include/uapi/linux/mroute6.h.
  *
- * MRT6_INIT                   200
- * MRT6_DONE                   201
- * MRT6_ADD_MIF                        202
- * MRT6_DEL_MIF                        203
- * MRT6_ADD_MFC                        204
- * MRT6_DEL_MFC                        205
- * MRT6_VERSION                        206
- * MRT6_ASSERT                 207
- * MRT6_PIM                    208
- * (reserved)                  209
+ * MRT6_BASE                   200
+ * ...
+ * MRT6_MAX
  */
 #endif /* _UAPI_LINUX_IN6_H */
index 16929993acc4976535c73bf8172e29789275bfeb..1c11004af5dba0e8069ac7e0b760067880480182 100644 (file)
@@ -26,6 +26,7 @@
 #define MRT_ASSERT     (MRT_BASE+7)    /* Activate PIM assert mode             */
 #define MRT_PIM                (MRT_BASE+8)    /* enable PIM code                      */
 #define MRT_TABLE      (MRT_BASE+9)    /* Specify mroute table ID              */
+#define MRT_MAX                (MRT_BASE+9)
 
 #define SIOCGETVIFCNT  SIOCPROTOPRIVATE        /* IP protocol privates */
 #define SIOCGETSGCNT   (SIOCPROTOPRIVATE+1)
index 3e89b5e7f9e33052adeb6b5dafa01944f02ee5cc..c206ae3a23274d3a2dcb5778abdd9e4739283e91 100644 (file)
@@ -26,6 +26,7 @@
 #define MRT6_ASSERT    (MRT6_BASE+7)   /* Activate PIM assert mode             */
 #define MRT6_PIM       (MRT6_BASE+8)   /* enable PIM code                      */
 #define MRT6_TABLE     (MRT6_BASE+9)   /* Specify mroute table ID              */
+#define MRT6_MAX       (MRT6_BASE+9)
 
 #define SIOCGETMIFCNT_IN6      SIOCPROTOPRIVATE        /* IP protocol privates */
 #define SIOCGETSGCNT_IN6       (SIOCPROTOPRIVATE+1)