]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: fix command "tc actions del" hang issue
authorChris Mi <chrism@mellanox.com>
Thu, 14 Dec 2017 09:09:00 +0000 (18:09 +0900)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 15 Dec 2017 05:17:04 +0000 (21:17 -0800)
If command is RTM_DELACTION, a non-NULL pointer is passed to rtnl_talk().
Then flag NLM_F_ACK is not set on n->nlmsg_flags and netlink_ack() will
not be called. Command tc will wait for the reply for ever.

Fixes: 86bf43c7c2fd ("lib/libnetlink: update rtnl_talk to support malloc buff at run time")
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Chris Mi <chrism@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/m_action.c

index 8185819db6baa5a2496da43f7779b33ed0ac4f4a..fc4223648e8cfc92fbd376183ade7a47fce2511b 100644 (file)
@@ -528,7 +528,7 @@ static int tc_action_gd(int cmd, unsigned int flags,
 
        req.n.nlmsg_seq = rth.dump = ++rth.seq;
 
-       if (rtnl_talk(&rth, &req.n, &ans) < 0) {
+       if (rtnl_talk(&rth, &req.n, cmd == RTM_DELACTION ? NULL : &ans) < 0) {
                fprintf(stderr, "We have an error talking to the kernel\n");
                return 1;
        }