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

Commit d71314b4 authored by Matti Vaittinen's avatar Matti Vaittinen Committed by David S. Miller
Browse files

IPv6 routing, NLM_F_* flag support: warn if new route is created without NLM_F_CREATE



The support for NLM_F_* flags at IPv6 routing requests.

Warn if NLM_F_CREATE flag is not defined for RTM_NEWROUTE request,
creating new table. Later NLM_F_CREATE may be required for
new route creation.

Patch created against linux-3.2-rc1

Signed-off-by: default avatarMatti Vaittinen <Mazziesaccount@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent abbd00b8
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -1230,9 +1230,18 @@ int ip6_route_add(struct fib6_config *cfg)
	if (cfg->fc_metric == 0)
	if (cfg->fc_metric == 0)
		cfg->fc_metric = IP6_RT_PRIO_USER;
		cfg->fc_metric = IP6_RT_PRIO_USER;


	err = -ENOBUFS;
	if (NULL != cfg->fc_nlinfo.nlh &&
	    !(cfg->fc_nlinfo.nlh->nlmsg_flags&NLM_F_CREATE)) {
		table = fib6_get_table(net, cfg->fc_table);
		if (table == NULL) {
			printk(KERN_WARNING "IPv6: NLM_F_CREATE should be specified when creating new route\n");
			table = fib6_new_table(net, cfg->fc_table);
			table = fib6_new_table(net, cfg->fc_table);
		}
	} else {
		table = fib6_new_table(net, cfg->fc_table);
	}
	if (table == NULL) {
	if (table == NULL) {
		err = -ENOBUFS;
		goto out;
		goto out;
	}
	}