Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37a1d361 authored by Roopa Prabhu's avatar Roopa Prabhu Committed by David S. Miller
Browse files

ipv6: include NLM_F_REPLACE in route replace notifications



This patch adds NLM_F_REPLACE flag to ipv6 route replace notifications.
This makes nlm_flags in ipv6 replace notifications consistent
with ipv4.

Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: default avatarMichal Kubecek <mkubecek@suse.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 20471ed4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -275,7 +275,8 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
	     struct nl_info *info, struct mx6_config *mxc);
int fib6_del(struct rt6_info *rt, struct nl_info *info);

void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info);
void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info,
		     unsigned int flags);

void fib6_run_gc(unsigned long expires, struct net *net, bool force);

+3 −3
Original line number Diff line number Diff line
@@ -851,7 +851,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
		*ins = rt;
		rt->rt6i_node = fn;
		atomic_inc(&rt->rt6i_ref);
		inet6_rt_notify(RTM_NEWROUTE, rt, info);
		inet6_rt_notify(RTM_NEWROUTE, rt, info, 0);
		info->nl_net->ipv6.rt6_stats->fib_rt_entries++;

		if (!(fn->fn_flags & RTN_RTINFO)) {
@@ -877,7 +877,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
		rt->rt6i_node = fn;
		rt->dst.rt6_next = iter->dst.rt6_next;
		atomic_inc(&rt->rt6i_ref);
		inet6_rt_notify(RTM_NEWROUTE, rt, info);
		inet6_rt_notify(RTM_NEWROUTE, rt, info, NLM_F_REPLACE);
		if (!(fn->fn_flags & RTN_RTINFO)) {
			info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
			fn->fn_flags |= RTN_RTINFO;
@@ -1422,7 +1422,7 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,

	fib6_purge_rt(rt, fn, net);

	inet6_rt_notify(RTM_DELROUTE, rt, info);
	inet6_rt_notify(RTM_DELROUTE, rt, info, 0);
	rt6_release(rt);
}

+3 −2
Original line number Diff line number Diff line
@@ -3304,7 +3304,8 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
	return err;
}

void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info)
void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info,
		     unsigned int nlm_flags)
{
	struct sk_buff *skb;
	struct net *net = info->nl_net;
@@ -3319,7 +3320,7 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info)
		goto errout;

	err = rt6_fill_node(net, skb, rt, NULL, NULL, 0,
				event, info->portid, seq, 0, 0, 0);
				event, info->portid, seq, 0, 0, nlm_flags);
	if (err < 0) {
		/* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
		WARN_ON(err == -EMSGSIZE);