mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 17:51:57 +09:00
ip6mr: fix mfc notification flags
[ Upstream commitf518338b16] Commit812e44dd18("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
38c50cd442
commit
29466c9fad
@@ -2351,13 +2351,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;
|
||||
|
||||
@@ -2425,7 +2426,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;
|
||||
|
||||
@@ -2464,7 +2465,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++;
|
||||
@@ -2478,7 +2480,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user