naccyde / rpms / iproute

Forked from rpms/iproute 10 months ago
Clone

Blame SOURCES/0042-tc-fix-command-tc-actions-del-hang-issue.patch

36cfb7
From dbc597c9d1e0e65cc9d989d8057f9a083c2f5779 Mon Sep 17 00:00:00 2001
36cfb7
From: Phil Sutter <psutter@redhat.com>
36cfb7
Date: Fri, 15 Dec 2017 16:13:46 +0100
36cfb7
Subject: [PATCH] tc: fix command "tc actions del" hang issue
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1526394
36cfb7
Upstream Status: iproute2.git commit 83cf5bc73b858
36cfb7
36cfb7
commit 83cf5bc73b858608d59c3c6126a9f37e793e15dd
36cfb7
Author: Chris Mi <chrism@mellanox.com>
36cfb7
Date:   Thu Dec 14 18:09:00 2017 +0900
36cfb7
36cfb7
    tc: fix command "tc actions del" hang issue
36cfb7
36cfb7
    If command is RTM_DELACTION, a non-NULL pointer is passed to rtnl_talk().
36cfb7
    Then flag NLM_F_ACK is not set on n->nlmsg_flags and netlink_ack() will
36cfb7
    not be called. Command tc will wait for the reply for ever.
36cfb7
36cfb7
    Fixes: 86bf43c7c2fd ("lib/libnetlink: update rtnl_talk to support malloc buff at run time")
36cfb7
    Reviewed-by: Jiri Pirko <jiri@mellanox.com>
36cfb7
    Signed-off-by: Chris Mi <chrism@mellanox.com>
36cfb7
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
36cfb7
---
36cfb7
 tc/m_action.c | 2 +-
36cfb7
 1 file changed, 1 insertion(+), 1 deletion(-)
36cfb7
36cfb7
diff --git a/tc/m_action.c b/tc/m_action.c
e138d9
index 90b2a11e5d9e8..7cfd9e0af145f 100644
36cfb7
--- a/tc/m_action.c
36cfb7
+++ b/tc/m_action.c
36cfb7
@@ -507,7 +507,7 @@ static int tc_action_gd(int cmd, unsigned int flags, int *argc_p, char ***argv_p
36cfb7
 
36cfb7
 	req.n.nlmsg_seq = rth.dump = ++rth.seq;
36cfb7
 
36cfb7
-	if (rtnl_talk(&rth, &req.n, &ans) < 0) {
36cfb7
+	if (rtnl_talk(&rth, &req.n, cmd == RTM_DELACTION ? NULL : &ans) < 0) {
36cfb7
 		fprintf(stderr, "We have an error talking to the kernel\n");
36cfb7
 		return 1;
36cfb7
 	}
36cfb7
-- 
e138d9
2.21.0
36cfb7