diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2014-03-19 12:47:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-14 09:42:17 -0400 |
commit | 29466c9fad0e72e57ded8dffabc68575d4399a4f (patch) | |
tree | 66f80846ae8fd290df9b6bbcc6eaec2471b13df7 /net | |
parent | 38c50cd4421b6d83ce58af63fdf105cf3fdc37e9 (diff) |
ip6mr: fix mfc notification flags
[ Upstream commit f518338b16038beeb73e155e60d0f70beb9379f4 ]
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>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6mr.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 9f44ebc17759..2c84072b1da7 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -2351,13 +2351,14 @@ int ip6mr_get_route(struct net *net, | |||
2351 | } | 2351 | } |
2352 | 2352 | ||
2353 | static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, | 2353 | static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, |
2354 | u32 portid, u32 seq, struct mfc6_cache *c, int cmd) | 2354 | u32 portid, u32 seq, struct mfc6_cache *c, int cmd, |
2355 | int flags) | ||
2355 | { | 2356 | { |
2356 | struct nlmsghdr *nlh; | 2357 | struct nlmsghdr *nlh; |
2357 | struct rtmsg *rtm; | 2358 | struct rtmsg *rtm; |
2358 | int err; | 2359 | int err; |
2359 | 2360 | ||
2360 | nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI); | 2361 | nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags); |
2361 | if (nlh == NULL) | 2362 | if (nlh == NULL) |
2362 | return -EMSGSIZE; | 2363 | return -EMSGSIZE; |
2363 | 2364 | ||
@@ -2425,7 +2426,7 @@ static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc, | |||
2425 | if (skb == NULL) | 2426 | if (skb == NULL) |
2426 | goto errout; | 2427 | goto errout; |
2427 | 2428 | ||
2428 | err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd); | 2429 | err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0); |
2429 | if (err < 0) | 2430 | if (err < 0) |
2430 | goto errout; | 2431 | goto errout; |
2431 | 2432 | ||
@@ -2464,7 +2465,8 @@ static int ip6mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb) | |||
2464 | if (ip6mr_fill_mroute(mrt, skb, | 2465 | if (ip6mr_fill_mroute(mrt, skb, |
2465 | NETLINK_CB(cb->skb).portid, | 2466 | NETLINK_CB(cb->skb).portid, |
2466 | cb->nlh->nlmsg_seq, | 2467 | cb->nlh->nlmsg_seq, |
2467 | mfc, RTM_NEWROUTE) < 0) | 2468 | mfc, RTM_NEWROUTE, |
2469 | NLM_F_MULTI) < 0) | ||
2468 | goto done; | 2470 | goto done; |
2469 | next_entry: | 2471 | next_entry: |
2470 | e++; | 2472 | e++; |
@@ -2478,7 +2480,8 @@ next_entry: | |||
2478 | if (ip6mr_fill_mroute(mrt, skb, | 2480 | if (ip6mr_fill_mroute(mrt, skb, |
2479 | NETLINK_CB(cb->skb).portid, | 2481 | NETLINK_CB(cb->skb).portid, |
2480 | cb->nlh->nlmsg_seq, | 2482 | cb->nlh->nlmsg_seq, |
2481 | mfc, RTM_NEWROUTE) < 0) { | 2483 | mfc, RTM_NEWROUTE, |
2484 | NLM_F_MULTI) < 0) { | ||
2482 | spin_unlock_bh(&mfc_unres_lock); | 2485 | spin_unlock_bh(&mfc_unres_lock); |
2483 | goto done; | 2486 | goto done; |
2484 | } | 2487 | } |