if (net->ipv6.devconf_all->disable_policy ||
idev->cnf.disable_policy)
- rt->dst.flags |= DST_NOPOLICY;
+ rt->dst_nopolicy = true;
neigh_parms_data_state_setall(idev->nd_parms);
int cpu;
rcu_read_lock();
- addrconf_set_nopolicy(ifa->rt, val);
+ ifa->rt->dst_nopolicy = val ? true : false;
if (rt->rt6i_pcpu) {
for_each_possible_cpu(cpu) {
struct rt6_info **rtp;
return fib6_prop[fib6_type];
}
+static unsigned short fib6_info_dst_flags(struct rt6_info *rt)
+{
+ unsigned short flags = 0;
+
+ if (rt->dst_nocount)
+ flags |= DST_NOCOUNT;
+ if (rt->dst_nopolicy)
+ flags |= DST_NOPOLICY;
+ if (rt->dst_host)
+ flags |= DST_HOST;
+
+ return flags;
+}
+
static void ip6_rt_init_dst_reject(struct rt6_info *rt, struct rt6_info *ort)
{
rt->dst.error = ip6_rt_type_to_error(ort->fib6_type);
static void ip6_rt_init_dst(struct rt6_info *rt, struct rt6_info *ort)
{
+ rt->dst.flags |= fib6_info_dst_flags(ort);
+
if (ort->rt6i_flags & RTF_REJECT) {
ip6_rt_init_dst_reject(rt, ort);
return;
rt->dst.output = ip6_output;
if (ort->fib6_type == RTN_LOCAL) {
- rt->dst.flags |= DST_HOST;
rt->dst.input = ip6_input;
} else if (ipv6_addr_type(&ort->rt6i_dst.addr) & IPV6_ADDR_MULTICAST) {
rt->dst.input = ip6_mc_input;
/* called with rcu_lock held */
static struct rt6_info *ip6_create_rt_rcu(struct rt6_info *rt)
{
+ unsigned short flags = fib6_info_dst_flags(rt);
struct net_device *dev = rt->fib6_nh.nh_dev;
struct rt6_info *nrt;
- nrt = __ip6_dst_alloc(dev_net(dev), dev, 0);
+ nrt = __ip6_dst_alloc(dev_net(dev), dev, flags);
if (nrt)
ip6_rt_copy_init(nrt, rt);
static struct rt6_info *ip6_rt_pcpu_alloc(struct rt6_info *rt)
{
+ unsigned short flags = fib6_info_dst_flags(rt);
struct net_device *dev;
struct rt6_info *pcpu_rt;
rcu_read_lock();
dev = ip6_rt_get_dev_rcu(rt);
- pcpu_rt = __ip6_dst_alloc(dev_net(dev), dev, rt->dst.flags);
+ pcpu_rt = __ip6_dst_alloc(dev_net(dev), dev, flags);
rcu_read_unlock();
if (!pcpu_rt)
return NULL;
ipv6_addr_prefix(&rt->rt6i_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);
rt->rt6i_dst.plen = cfg->fc_dst_len;
if (rt->rt6i_dst.plen == 128)
- rt->dst.flags |= DST_HOST;
+ rt->dst_host = true;
#ifdef CONFIG_IPV6_SUBTREES
ipv6_addr_prefix(&rt->rt6i_src.addr, &cfg->fc_src, cfg->fc_src_len);
if (!rt)
return ERR_PTR(-ENOMEM);
+ rt->dst_nocount = true;
+
in6_dev_hold(idev);
rt->rt6i_idev = idev;
- rt->dst.flags |= DST_HOST;
+ rt->dst_host = true;
rt->rt6i_protocol = RTPROT_KERNEL;
rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP;
if (anycast) {