Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux.git] / drivers / net / vrf.c
index ac40924fe437d35226caeeb26aea1af3ef6d0fbb..0a2b180d138a48674e94dd144ab9e5b4a3244b7c 100644 (file)
@@ -737,7 +737,6 @@ static int vrf_rtable_create(struct net_device *dev)
                return -ENOMEM;
 
        rth->dst.output = vrf_output;
-       rth->rt_table_id = vrf->tb_id;
 
        rcu_assign_pointer(vrf->rth, rth);
 
@@ -943,6 +942,7 @@ static struct rt6_info *vrf_ip6_route_lookup(struct net *net,
                                             const struct net_device *dev,
                                             struct flowi6 *fl6,
                                             int ifindex,
+                                            const struct sk_buff *skb,
                                             int flags)
 {
        struct net_vrf *vrf = netdev_priv(dev);
@@ -961,7 +961,7 @@ static struct rt6_info *vrf_ip6_route_lookup(struct net *net,
        if (!table)
                return NULL;
 
-       return ip6_pol_route(net, table, ifindex, fl6, flags);
+       return ip6_pol_route(net, table, ifindex, fl6, skb, flags);
 }
 
 static void vrf_ip6_input_dst(struct sk_buff *skb, struct net_device *vrf_dev,
@@ -979,7 +979,7 @@ static void vrf_ip6_input_dst(struct sk_buff *skb, struct net_device *vrf_dev,
        struct net *net = dev_net(vrf_dev);
        struct rt6_info *rt6;
 
-       rt6 = vrf_ip6_route_lookup(net, vrf_dev, &fl6, ifindex,
+       rt6 = vrf_ip6_route_lookup(net, vrf_dev, &fl6, ifindex, skb,
                                   RT6_LOOKUP_F_HAS_SADDR | RT6_LOOKUP_F_IFACE);
        if (unlikely(!rt6))
                return;
@@ -1112,7 +1112,7 @@ static struct dst_entry *vrf_link_scope_lookup(const struct net_device *dev,
        if (!ipv6_addr_any(&fl6->saddr))
                flags |= RT6_LOOKUP_F_HAS_SADDR;
 
-       rt = vrf_ip6_route_lookup(net, dev, fl6, fl6->flowi6_oif, flags);
+       rt = vrf_ip6_route_lookup(net, dev, fl6, fl6->flowi6_oif, NULL, flags);
        if (rt)
                dst = &rt->dst;
 
@@ -1147,6 +1147,7 @@ static inline size_t vrf_fib_rule_nl_size(void)
        sz  = NLMSG_ALIGN(sizeof(struct fib_rule_hdr));
        sz += nla_total_size(sizeof(u8));       /* FRA_L3MDEV */
        sz += nla_total_size(sizeof(u32));      /* FRA_PRIORITY */
+       sz += nla_total_size(sizeof(u8));       /* FRA_PROTOCOL */
 
        return sz;
 }
@@ -1177,6 +1178,9 @@ static int vrf_fib_rule(const struct net_device *dev, __u8 family, bool add_it)
        frh->family = family;
        frh->action = FR_ACT_TO_TBL;
 
+       if (nla_put_u8(skb, FRA_PROTOCOL, RTPROT_KERNEL))
+               goto nla_put_failure;
+
        if (nla_put_u8(skb, FRA_L3MDEV, 1))
                goto nla_put_failure;
 
This page took 0.033997 seconds and 4 git commands to generate.