]> Git Repo - linux.git/blobdiff - net/ipv6/ndisc.c
ipv6: Move xfrm_lookup() call down into icmp6_dst_alloc().
[linux.git] / net / ipv6 / ndisc.c
index a4769881c5b5eea69d4a1c00fd9012a85330ad01..f3e50c29add42a1ce66d137c8cd77bfa9174ddc3 100644 (file)
@@ -126,7 +126,6 @@ static const struct neigh_ops ndisc_direct_ops = {
 
 struct neigh_table nd_tbl = {
        .family =       AF_INET6,
-       .entry_size =   sizeof(struct neighbour) + sizeof(struct in6_addr),
        .key_len =      sizeof(struct in6_addr),
        .hash =         ndisc_hash,
        .constructor =  ndisc_constructor,
@@ -517,14 +516,7 @@ void ndisc_send_skb(struct sk_buff *skb,
        type = icmp6h->icmp6_type;
 
        icmpv6_flow_init(sk, &fl6, type, saddr, daddr, dev->ifindex);
-
-       dst = icmp6_dst_alloc(dev, neigh, daddr);
-       if (!dst) {
-               kfree_skb(skb);
-               return;
-       }
-
-       dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
+       dst = icmp6_dst_alloc(dev, neigh, &fl6);
        if (IS_ERR(dst)) {
                kfree_skb(skb);
                return;
@@ -1239,7 +1231,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
        rt = rt6_get_dflt_router(&ipv6_hdr(skb)->saddr, skb->dev);
 
        if (rt)
-               neigh = dst_get_neighbour(&rt->dst);
+               neigh = dst_get_neighbour_noref(&rt->dst);
 
        if (rt && lifetime == 0) {
                neigh_clone(neigh);
@@ -1259,7 +1251,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
                        return;
                }
 
-               neigh = dst_get_neighbour(&rt->dst);
+               neigh = dst_get_neighbour_noref(&rt->dst);
                if (neigh == NULL) {
                        ND_PRINTK0(KERN_ERR
                                   "ICMPv6 RA: %s() got default router without neighbour.\n",
@@ -1574,7 +1566,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
        }
        if (!rt->rt6i_peer)
                rt6_bind_peer(rt, 1);
-       if (inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ))
+       if (!inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ))
                goto release;
 
        if (dev->addr_len) {
This page took 0.034392 seconds and 4 git commands to generate.