net: ethernet: stmmac: dwmac-sun8i: enable support of unicast filtering
[linux-2.6-microblaze.git] / drivers / net / vrf.c
index 9ee4d74..cf7e6a9 100644 (file)
@@ -370,7 +370,7 @@ static int vrf_finish_output6(struct net *net, struct sock *sk,
                neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false);
        if (!IS_ERR(neigh)) {
                sock_confirm_neigh(skb, neigh);
-               ret = neigh_output(neigh, skb);
+               ret = neigh_output(neigh, skb, false);
                rcu_read_unlock_bh();
                return ret;
        }
@@ -549,7 +549,7 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s
        struct net_device *dev = dst->dev;
        unsigned int hh_len = LL_RESERVED_SPACE(dev);
        struct neighbour *neigh;
-       u32 nexthop;
+       bool is_v6gw = false;
        int ret = -EINVAL;
 
        nf_reset(skb);
@@ -572,13 +572,11 @@ static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *s
 
        rcu_read_lock_bh();
 
-       nexthop = (__force u32)rt_nexthop(rt, ip_hdr(skb)->daddr);
-       neigh = __ipv4_neigh_lookup_noref(dev, nexthop);
-       if (unlikely(!neigh))
-               neigh = __neigh_create(&arp_tbl, &nexthop, dev, false);
+       neigh = ip_neigh_for_gw(rt, skb, &is_v6gw);
        if (!IS_ERR(neigh)) {
                sock_confirm_neigh(skb, neigh);
-               ret = neigh_output(neigh, skb);
+               /* if crossing protocols, can not use the cached header */
+               ret = neigh_output(neigh, skb, is_v6gw);
                rcu_read_unlock_bh();
                return ret;
        }