[RHEL7,COMMIT] net: Change number of netlink repair

Submitted by Konstantin Khorenko on April 13, 2018, 4:18 p.m.

Details

Message ID 201804131618.w3DGIiE1012218@finist_ce7.work
State New
Series "net: Change number of netlink repair"
Headers show

Commit Message

Konstantin Khorenko April 13, 2018, 4:18 p.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.46.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.46.5
------>
commit 9cdd731a629a0c83ae8864759944aa62d9c8bd5b
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Apr 13 19:18:44 2018 +0300

    net: Change number of netlink repair
    
    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>
    Acked-by: Konstantin Khorenko <khorenko@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))