[Devel] [PATCH] net: Change number of netlink repair

Kirill Tkhai ktkhai at virtuozzo.com
Fri Apr 13 15:40:03 MSK 2018


Mainstream has NETLINK_EXT_ACK 11, which is used by fresh
iproute utils. We don't want these utils switch the socket
in repair mode.

https://jira.sw.ru/browse/PSBM-83415

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 include/uapi/linux/netlink.h |    3 ++-
 net/netlink/af_netlink.c     |    2 +-
 net/netlink/af_netlink.h     |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
index 56ddadf14e0e..5d202cc19705 100644
--- a/include/uapi/linux/netlink.h
+++ b/include/uapi/linux/netlink.h
@@ -111,7 +111,8 @@ struct nlmsgerr {
 #define NETLINK_LISTEN_ALL_NSID		8
 #define NETLINK_LIST_MEMBERSHIPS	9
 #define NETLINK_CAP_ACK			10
-#define NETLINK_REPAIR			11
+
+#define NETLINK_REPAIR2			127
 
 struct nl_pktinfo {
 	__u32	group;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 513597d267eb..0d02a287ea79 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2192,7 +2192,7 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname,
 		return -EFAULT;
 
 	switch (optname) {
-	case NETLINK_REPAIR:
+	case NETLINK_REPAIR2:
 		if (val)
 			nlk->flags |= NETLINK_F_REPAIR;
 		else
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h
index 041b5da8bd5d..07bac2ff1054 100644
--- a/net/netlink/af_netlink.h
+++ b/net/netlink/af_netlink.h
@@ -11,7 +11,8 @@
 #define NETLINK_F_RECV_NO_ENOBUFS	0x8
 #define NETLINK_F_LISTEN_ALL_NSID	0x10
 #define NETLINK_F_CAP_ACK		0x20
-#define NETLINK_F_REPAIR		0x40
+
+#define NETLINK_F_REPAIR		0x80000000
 
 #define NLGRPSZ(x)	(ALIGN(x, sizeof(unsigned long) * 8) / 8)
 #define NLGRPLONGS(x)	(NLGRPSZ(x)/sizeof(unsigned long))



More information about the Devel mailing list