All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/3] rtnetlink: fix fdb notification flags
@ 2014-03-19 16:47 Nicolas Dichtel
  2014-03-19 16:47 ` [PATCH net 2/3] ipmr: fix mfc " Nicolas Dichtel
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Nicolas Dichtel @ 2014-03-19 16:47 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel, Thomas Graf

Commit 3ff661c38c84 ("net: rtnetlink notify events for FDB NTF_SELF adds and
deletes") reuses the function nlmsg_populate_fdb_fill() to notify fdb events.
But this function was used only for dump and thus was always setting the
flag NLM_F_MULTI, which is wrong in case of a single notification.

Libraries like libnl will wait forever for NLMSG_DONE.

CC: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/rtnetlink.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 1a0dac2ef9ad..120eecc0f5a4 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2121,12 +2121,13 @@ EXPORT_SYMBOL(rtmsg_ifinfo);
 static int nlmsg_populate_fdb_fill(struct sk_buff *skb,
 				   struct net_device *dev,
 				   u8 *addr, u32 pid, u32 seq,
-				   int type, unsigned int flags)
+				   int type, unsigned int flags,
+				   int nlflags)
 {
 	struct nlmsghdr *nlh;
 	struct ndmsg *ndm;
 
-	nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), NLM_F_MULTI);
+	nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags);
 	if (!nlh)
 		return -EMSGSIZE;
 
@@ -2164,7 +2165,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, int type)
 	if (!skb)
 		goto errout;
 
-	err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF);
+	err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF, 0);
 	if (err < 0) {
 		kfree_skb(skb);
 		goto errout;
@@ -2389,7 +2390,8 @@ static int nlmsg_populate_fdb(struct sk_buff *skb,
 
 		err = nlmsg_populate_fdb_fill(skb, dev, ha->addr,
 					      portid, seq,
-					      RTM_NEWNEIGH, NTF_SELF);
+					      RTM_NEWNEIGH, NTF_SELF,
+					      NLM_F_MULTI);
 		if (err < 0)
 			return err;
 skip:
-- 
1.8.5.4

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

* [PATCH net 2/3] ipmr: fix mfc notification flags
  2014-03-19 16:47 [PATCH net 1/3] rtnetlink: fix fdb notification flags Nicolas Dichtel
@ 2014-03-19 16:47 ` Nicolas Dichtel
  2014-03-20  7:39   ` Thomas Graf
  2014-03-20 20:25   ` David Miller
  2014-03-19 16:47 ` [PATCH net 3/3] ip6mr: " Nicolas Dichtel
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Nicolas Dichtel @ 2014-03-19 16:47 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel, Thomas Graf

Commit 8cd3ac9f9b7b ("ipmr: advertise new mfc entries via rtnl") reuses the
function ipmr_fill_mroute() to notify mfc events.
But this function was used only for dump and thus was always setting the
flag NLM_F_MULTI, which is wrong in case of a single notification.

Libraries like libnl will wait forever for NLMSG_DONE.

CC: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv4/ipmr.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index b9b3472975ba..28863570dd60 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -2255,13 +2255,14 @@ int ipmr_get_route(struct net *net, struct sk_buff *skb,
 }
 
 static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
-			    u32 portid, u32 seq, struct mfc_cache *c, int cmd)
+			    u32 portid, u32 seq, struct mfc_cache *c, int cmd,
+			    int flags)
 {
 	struct nlmsghdr *nlh;
 	struct rtmsg *rtm;
 	int err;
 
-	nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI);
+	nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags);
 	if (nlh == NULL)
 		return -EMSGSIZE;
 
@@ -2329,7 +2330,7 @@ static void mroute_netlink_event(struct mr_table *mrt, struct mfc_cache *mfc,
 	if (skb == NULL)
 		goto errout;
 
-	err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd);
+	err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0);
 	if (err < 0)
 		goto errout;
 
@@ -2368,7 +2369,8 @@ static int ipmr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
 				if (ipmr_fill_mroute(mrt, skb,
 						     NETLINK_CB(cb->skb).portid,
 						     cb->nlh->nlmsg_seq,
-						     mfc, RTM_NEWROUTE) < 0)
+						     mfc, RTM_NEWROUTE,
+						     NLM_F_MULTI) < 0)
 					goto done;
 next_entry:
 				e++;
@@ -2382,7 +2384,8 @@ next_entry:
 			if (ipmr_fill_mroute(mrt, skb,
 					     NETLINK_CB(cb->skb).portid,
 					     cb->nlh->nlmsg_seq,
-					     mfc, RTM_NEWROUTE) < 0) {
+					     mfc, RTM_NEWROUTE,
+					     NLM_F_MULTI) < 0) {
 				spin_unlock_bh(&mfc_unres_lock);
 				goto done;
 			}
-- 
1.8.5.4

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

* [PATCH net 3/3] ip6mr: fix mfc notification flags
  2014-03-19 16:47 [PATCH net 1/3] rtnetlink: fix fdb notification flags Nicolas Dichtel
  2014-03-19 16:47 ` [PATCH net 2/3] ipmr: fix mfc " Nicolas Dichtel
@ 2014-03-19 16:47 ` Nicolas Dichtel
  2014-03-20  7:39   ` Thomas Graf
  2014-03-20 20:25   ` David Miller
  2014-03-20  7:38 ` [PATCH net 1/3] rtnetlink: fix fdb " Thomas Graf
  2014-03-20 20:25 ` David Miller
  3 siblings, 2 replies; 11+ messages in thread
From: Nicolas Dichtel @ 2014-03-19 16:47 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel, Thomas Graf

Commit 812e44dd1829 ("ip6mr: advertise new mfc entries via rtnl") reuses the
function ip6mr_fill_mroute() to notify mfc events.
But this function was used only for dump and thus was always setting the
flag NLM_F_MULTI, which is wrong in case of a single notification.

Libraries like libnl will wait forever for NLMSG_DONE.

CC: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/ip6mr.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 0eb4038a4d63..8737400af0a0 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -2349,13 +2349,14 @@ int ip6mr_get_route(struct net *net,
 }
 
 static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
-			     u32 portid, u32 seq, struct mfc6_cache *c, int cmd)
+			     u32 portid, u32 seq, struct mfc6_cache *c, int cmd,
+			     int flags)
 {
 	struct nlmsghdr *nlh;
 	struct rtmsg *rtm;
 	int err;
 
-	nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI);
+	nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags);
 	if (nlh == NULL)
 		return -EMSGSIZE;
 
@@ -2423,7 +2424,7 @@ static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc,
 	if (skb == NULL)
 		goto errout;
 
-	err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd);
+	err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0);
 	if (err < 0)
 		goto errout;
 
@@ -2462,7 +2463,8 @@ static int ip6mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)
 				if (ip6mr_fill_mroute(mrt, skb,
 						      NETLINK_CB(cb->skb).portid,
 						      cb->nlh->nlmsg_seq,
-						      mfc, RTM_NEWROUTE) < 0)
+						      mfc, RTM_NEWROUTE,
+						      NLM_F_MULTI) < 0)
 					goto done;
 next_entry:
 				e++;
@@ -2476,7 +2478,8 @@ next_entry:
 			if (ip6mr_fill_mroute(mrt, skb,
 					      NETLINK_CB(cb->skb).portid,
 					      cb->nlh->nlmsg_seq,
-					      mfc, RTM_NEWROUTE) < 0) {
+					      mfc, RTM_NEWROUTE,
+					      NLM_F_MULTI) < 0) {
 				spin_unlock_bh(&mfc_unres_lock);
 				goto done;
 			}
-- 
1.8.5.4

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

* Re: [PATCH net 1/3] rtnetlink: fix fdb notification flags
  2014-03-19 16:47 [PATCH net 1/3] rtnetlink: fix fdb notification flags Nicolas Dichtel
  2014-03-19 16:47 ` [PATCH net 2/3] ipmr: fix mfc " Nicolas Dichtel
  2014-03-19 16:47 ` [PATCH net 3/3] ip6mr: " Nicolas Dichtel
@ 2014-03-20  7:38 ` Thomas Graf
  2014-03-20 20:25 ` David Miller
  3 siblings, 0 replies; 11+ messages in thread
From: Thomas Graf @ 2014-03-20  7:38 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: davem, netdev

On 03/19/14 at 05:47pm, Nicolas Dichtel wrote:
> Commit 3ff661c38c84 ("net: rtnetlink notify events for FDB NTF_SELF adds and
> deletes") reuses the function nlmsg_populate_fdb_fill() to notify fdb events.
> But this function was used only for dump and thus was always setting the
> flag NLM_F_MULTI, which is wrong in case of a single notification.
> 
> Libraries like libnl will wait forever for NLMSG_DONE.
> 
> CC: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

LGTM

Acked-by: Thomas Graf <tgraf@suug.ch>

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

* Re: [PATCH net 2/3] ipmr: fix mfc notification flags
  2014-03-19 16:47 ` [PATCH net 2/3] ipmr: fix mfc " Nicolas Dichtel
@ 2014-03-20  7:39   ` Thomas Graf
  2014-03-20 20:25   ` David Miller
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Graf @ 2014-03-20  7:39 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: davem, netdev

On 03/19/14 at 05:47pm, Nicolas Dichtel wrote:
> Commit 8cd3ac9f9b7b ("ipmr: advertise new mfc entries via rtnl") reuses the
> function ipmr_fill_mroute() to notify mfc events.
> But this function was used only for dump and thus was always setting the
> flag NLM_F_MULTI, which is wrong in case of a single notification.
> 
> Libraries like libnl will wait forever for NLMSG_DONE.
> 
> CC: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

LGTM

Acked-by: Thomas Graf <tgraf@suug.ch>

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

* Re: [PATCH net 3/3] ip6mr: fix mfc notification flags
  2014-03-19 16:47 ` [PATCH net 3/3] ip6mr: " Nicolas Dichtel
@ 2014-03-20  7:39   ` Thomas Graf
  2014-03-20 20:25   ` David Miller
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Graf @ 2014-03-20  7:39 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: davem, netdev

On 03/19/14 at 05:47pm, Nicolas Dichtel wrote:
> Commit 812e44dd1829 ("ip6mr: advertise new mfc entries via rtnl") reuses the
> function ip6mr_fill_mroute() to notify mfc events.
> But this function was used only for dump and thus was always setting the
> flag NLM_F_MULTI, which is wrong in case of a single notification.
> 
> Libraries like libnl will wait forever for NLMSG_DONE.
> 
> CC: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

LGTM

Acked-by: Thomas Graf <tgraf@suug.ch>

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

* Re: [PATCH net 1/3] rtnetlink: fix fdb notification flags
  2014-03-19 16:47 [PATCH net 1/3] rtnetlink: fix fdb notification flags Nicolas Dichtel
                   ` (2 preceding siblings ...)
  2014-03-20  7:38 ` [PATCH net 1/3] rtnetlink: fix fdb " Thomas Graf
@ 2014-03-20 20:25 ` David Miller
  2014-03-21  9:18   ` Nicolas Dichtel
  3 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2014-03-20 20:25 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, tgraf

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 19 Mar 2014 17:47:49 +0100

> Commit 3ff661c38c84 ("net: rtnetlink notify events for FDB NTF_SELF adds and
> deletes") reuses the function nlmsg_populate_fdb_fill() to notify fdb events.
> But this function was used only for dump and thus was always setting the
> flag NLM_F_MULTI, which is wrong in case of a single notification.
> 
> Libraries like libnl will wait forever for NLMSG_DONE.
> 
> CC: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

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

* Re: [PATCH net 2/3] ipmr: fix mfc notification flags
  2014-03-19 16:47 ` [PATCH net 2/3] ipmr: fix mfc " Nicolas Dichtel
  2014-03-20  7:39   ` Thomas Graf
@ 2014-03-20 20:25   ` David Miller
  1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2014-03-20 20:25 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, tgraf

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 19 Mar 2014 17:47:50 +0100

> Commit 8cd3ac9f9b7b ("ipmr: advertise new mfc entries via rtnl") reuses the
> function ipmr_fill_mroute() to notify mfc events.
> But this function was used only for dump and thus was always setting the
> flag NLM_F_MULTI, which is wrong in case of a single notification.
> 
> Libraries like libnl will wait forever for NLMSG_DONE.
> 
> CC: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

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

* Re: [PATCH net 3/3] ip6mr: fix mfc notification flags
  2014-03-19 16:47 ` [PATCH net 3/3] ip6mr: " Nicolas Dichtel
  2014-03-20  7:39   ` Thomas Graf
@ 2014-03-20 20:25   ` David Miller
  1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2014-03-20 20:25 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, tgraf

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 19 Mar 2014 17:47:51 +0100

> Commit 812e44dd1829 ("ip6mr: advertise new mfc entries via rtnl") reuses the
> function ip6mr_fill_mroute() to notify mfc events.
> But this function was used only for dump and thus was always setting the
> flag NLM_F_MULTI, which is wrong in case of a single notification.
> 
> Libraries like libnl will wait forever for NLMSG_DONE.
> 
> CC: Thomas Graf <tgraf@suug.ch>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied.

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

* Re: [PATCH net 1/3] rtnetlink: fix fdb notification flags
  2014-03-20 20:25 ` David Miller
@ 2014-03-21  9:18   ` Nicolas Dichtel
  2014-03-21 18:27     ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Nicolas Dichtel @ 2014-03-21  9:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, tgraf

Le 20/03/2014 21:25, David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Date: Wed, 19 Mar 2014 17:47:49 +0100
>
>> Commit 3ff661c38c84 ("net: rtnetlink notify events for FDB NTF_SELF adds and
>> deletes") reuses the function nlmsg_populate_fdb_fill() to notify fdb events.
>> But this function was used only for dump and thus was always setting the
>> flag NLM_F_MULTI, which is wrong in case of a single notification.
>>
>> Libraries like libnl will wait forever for NLMSG_DONE.
>>
>> CC: Thomas Graf <tgraf@suug.ch>
>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>
> Applied.
>
David, do you plan to queue this serie in stable branch?
Applications using libnl may be stuck with this bug.


Thank you,
Nicolas

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

* Re: [PATCH net 1/3] rtnetlink: fix fdb notification flags
  2014-03-21  9:18   ` Nicolas Dichtel
@ 2014-03-21 18:27     ` David Miller
  0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2014-03-21 18:27 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev, tgraf

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri, 21 Mar 2014 10:18:36 +0100

> David, do you plan to queue this serie in stable branch?

I've added it to the queue now, thanks.

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

end of thread, other threads:[~2014-03-21 18:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19 16:47 [PATCH net 1/3] rtnetlink: fix fdb notification flags Nicolas Dichtel
2014-03-19 16:47 ` [PATCH net 2/3] ipmr: fix mfc " Nicolas Dichtel
2014-03-20  7:39   ` Thomas Graf
2014-03-20 20:25   ` David Miller
2014-03-19 16:47 ` [PATCH net 3/3] ip6mr: " Nicolas Dichtel
2014-03-20  7:39   ` Thomas Graf
2014-03-20 20:25   ` David Miller
2014-03-20  7:38 ` [PATCH net 1/3] rtnetlink: fix fdb " Thomas Graf
2014-03-20 20:25 ` David Miller
2014-03-21  9:18   ` Nicolas Dichtel
2014-03-21 18:27     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.