net: Change number of netlink repair

Submitted by Kirill Tkhai on April 13, 2018, 12:40 p.m.

Details

Message ID 152362316328.26884.11772306112606597935.stgit@localhost.localdomain
State New
Series "net: Change number of netlink repair"
Headers show

Commit Message

Kirill Tkhai April 13, 2018, 12:40 p.m.
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@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(-)

Patch hide | download patch | download mbox

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))