netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch iproute2] tc: fix command "tc actions del" hang issue
@ 2017-12-14  9:09 Chris Mi
  2017-12-15  5:16 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Mi @ 2017-12-14  9:09 UTC (permalink / raw)
  To: netdev; +Cc: jiri

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")
Signed-off-by: Chris Mi <chrism@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
---
 tc/m_action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/m_action.c b/tc/m_action.c
index afb6cfad..986ef7d0 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -529,7 +529,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;
 	}
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch iproute2] tc: fix command "tc actions del" hang issue
  2017-12-14  9:09 [patch iproute2] tc: fix command "tc actions del" hang issue Chris Mi
@ 2017-12-15  5:16 ` Stephen Hemminger
  2017-12-18  1:41   ` Chris Mi
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2017-12-15  5:16 UTC (permalink / raw)
  To: Chris Mi; +Cc: netdev, jiri

On Thu, 14 Dec 2017 18:09:00 +0900
Chris Mi <chrism@mellanox.com> wrote:

> 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")
> Signed-off-by: Chris Mi <chrism@mellanox.com>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>

Thanks for fixing this.
Applied, but please don't linewrap the fixes tag.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [patch iproute2] tc: fix command "tc actions del" hang issue
  2017-12-15  5:16 ` Stephen Hemminger
@ 2017-12-18  1:41   ` Chris Mi
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Mi @ 2017-12-18  1:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev@vger.kernel.org, jiri@resnulli.us

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, December 15, 2017 1:17 PM
> To: Chris Mi <chrism@mellanox.com>
> Cc: netdev@vger.kernel.org; jiri@resnulli.us
> Subject: Re: [patch iproute2] tc: fix command "tc actions del" hang issue
> 
> On Thu, 14 Dec 2017 18:09:00 +0900
> Chris Mi <chrism@mellanox.com> wrote:
> 
> > 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")
> > Signed-off-by: Chris Mi <chrism@mellanox.com>
> > Reviewed-by: Jiri Pirko <jiri@mellanox.com>
> 
> Thanks for fixing this.
> Applied, but please don't linewrap the fixes tag.
Thank for fixing it. I'll pay attention to it next time.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-18  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-14  9:09 [patch iproute2] tc: fix command "tc actions del" hang issue Chris Mi
2017-12-15  5:16 ` Stephen Hemminger
2017-12-18  1:41   ` Chris Mi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).