diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2014-03-19 12:47:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-20 16:24:28 -0400 |
commit | 1c104a6bebf3c16b6248408b84f91d09ac8a26b6 (patch) | |
tree | 0a105a5d58debe396c0c6ddad1e2bc271dbd98af | |
parent | 632623153196bf183a69686ed9c07eee98ff1bf8 (diff) |
rtnetlink: fix fdb notification flags
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>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/rtnetlink.c | 10 |
1 files 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); | |||
2121 | static int nlmsg_populate_fdb_fill(struct sk_buff *skb, | 2121 | static int nlmsg_populate_fdb_fill(struct sk_buff *skb, |
2122 | struct net_device *dev, | 2122 | struct net_device *dev, |
2123 | u8 *addr, u32 pid, u32 seq, | 2123 | u8 *addr, u32 pid, u32 seq, |
2124 | int type, unsigned int flags) | 2124 | int type, unsigned int flags, |
2125 | int nlflags) | ||
2125 | { | 2126 | { |
2126 | struct nlmsghdr *nlh; | 2127 | struct nlmsghdr *nlh; |
2127 | struct ndmsg *ndm; | 2128 | struct ndmsg *ndm; |
2128 | 2129 | ||
2129 | nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), NLM_F_MULTI); | 2130 | nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags); |
2130 | if (!nlh) | 2131 | if (!nlh) |
2131 | return -EMSGSIZE; | 2132 | return -EMSGSIZE; |
2132 | 2133 | ||
@@ -2164,7 +2165,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, int type) | |||
2164 | if (!skb) | 2165 | if (!skb) |
2165 | goto errout; | 2166 | goto errout; |
2166 | 2167 | ||
2167 | err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF); | 2168 | err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF, 0); |
2168 | if (err < 0) { | 2169 | if (err < 0) { |
2169 | kfree_skb(skb); | 2170 | kfree_skb(skb); |
2170 | goto errout; | 2171 | goto errout; |
@@ -2389,7 +2390,8 @@ static int nlmsg_populate_fdb(struct sk_buff *skb, | |||
2389 | 2390 | ||
2390 | err = nlmsg_populate_fdb_fill(skb, dev, ha->addr, | 2391 | err = nlmsg_populate_fdb_fill(skb, dev, ha->addr, |
2391 | portid, seq, | 2392 | portid, seq, |
2392 | RTM_NEWNEIGH, NTF_SELF); | 2393 | RTM_NEWNEIGH, NTF_SELF, |
2394 | NLM_F_MULTI); | ||
2393 | if (err < 0) | 2395 | if (err < 0) |
2394 | return err; | 2396 | return err; |
2395 | skip: | 2397 | skip: |