From: Chris Mi Date: Thu, 14 Dec 2017 09:09:00 +0000 (+0900) Subject: tc: fix command "tc actions del" hang issue X-Git-Tag: v4.15.0~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83cf5bc73b858608d59c3c6126a9f37e793e15dd;p=thirdparty%2Fiproute2.git tc: fix command "tc actions del" hang issue 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 Signed-off-by: Chris Mi Signed-off-by: Stephen Hemminger --- diff --git a/tc/m_action.c b/tc/m_action.c index 8185819db..fc4223648 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -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; }