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

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 27 13:39:50 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.47.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.47.2
------>
commit 08dc16449a39f68ca5a5db116e842ca33f1a3a19
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Apr 27 13:39:50 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 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 d5afa0322990..a1c0e82f9ec4 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2195,7 +2195,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