diff mbox series

[RFC,iproute2] ip: revert including new features in all cases

Message ID 20221025214254.103427-1-stephen@networkplumber.org (mailing list archive)
State RFC
Delegated to: David Ahern
Headers show
Series [RFC,iproute2] ip: revert including new features in all cases | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger Oct. 25, 2022, 9:42 p.m. UTC
The problem is ip commands built from latest version still have to
run on older kernels.  Running current "ip monitor" on older
kernels would fail because it could not add the group for stats
since rtnl group for stats was not added until 5.18 kernel.

The proposed solution is to revert the inclusion of new features
that could be rejected by older kernels from the default "all"
setting of ip monitor.

This effectively reverts commit 4e8a9914c4d459be57ddedf1df35b315e7fea8a5.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 ip/ipmonitor.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 8a72ea42db73..ea91166b5fe9 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -190,7 +190,12 @@  static int accept_msg(struct rtnl_ctrl_data *ctrl,
 #define IPMON_LNSID		BIT(9)
 #define IPMON_LNEXTHOP		BIT(10)
 
-#define IPMON_L_ALL		(~0)
+/* All only includes those bit supported by older kernels */
+#define IPMON_L_ALL	(IPMON_LLINK | IPMON_LADDR |	\
+			 IPMON_LROUTE | IPMON_LMROUTE | \
+			 IPMON_LPREFIX | IPMON_LNEIGH |	\
+			 IPMON_LNETCONF | IPMON_LRULE | \
+			 IPMON_LNSID)
 
 int do_ipmonitor(int argc, char **argv)
 {