]> err.no Git - linux-2.6/blobdiff - net/ipv6/raw.c
[PATCH] fs: remove redundant timespec_equal test in update_atime()
[linux-2.6] / net / ipv6 / raw.c
index 9db0de81f0741c88b8f5818f2aad1cb3356c9755..ed3a76b30fd932db9153b0fd31ea405ff97cc15a 100644 (file)
@@ -49,6 +49,7 @@
 #include <net/transp_v6.h>
 #include <net/udp.h>
 #include <net/inet_common.h>
+#include <net/tcp_states.h>
 
 #include <net/rawv6.h>
 #include <net/xfrm.h>
@@ -141,11 +142,12 @@ static __inline__ int icmpv6_filter(struct sock *sk, struct sk_buff *skb)
  *
  *     Caller owns SKB so we must make clones.
  */
-void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
+int ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
 {
        struct in6_addr *saddr;
        struct in6_addr *daddr;
        struct sock *sk;
+       int delivered = 0;
        __u8 hash;
 
        saddr = &skb->nh.ipv6h->saddr;
@@ -164,9 +166,10 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
        if (sk == NULL)
                goto out;
 
-       sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr, skb->dev->ifindex);
+       sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr, IP6CB(skb)->iif);
 
        while (sk) {
+               delivered = 1;
                if (nexthdr != IPPROTO_ICMPV6 || !icmpv6_filter(sk, skb)) {
                        struct sk_buff *clone = skb_clone(skb, GFP_ATOMIC);
 
@@ -175,10 +178,11 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
                                rawv6_rcv(sk, clone);
                }
                sk = __raw_v6_lookup(sk_next(sk), nexthdr, daddr, saddr,
-                                    skb->dev->ifindex);
+                                    IP6CB(skb)->iif);
        }
 out:
        read_unlock(&raw_v6_lock);
+       return delivered;
 }
 
 /* This cleans up af_inet6 a bit. -DaveM */
@@ -339,8 +343,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
                        if (csum_ipv6_magic(&skb->nh.ipv6h->saddr,
                                            &skb->nh.ipv6h->daddr,
                                            skb->len, inet->num, skb->csum)) {
-                               LIMIT_NETDEBUG(
-                               printk(KERN_DEBUG "raw v6 hw csum failure.\n"));
+                               LIMIT_NETDEBUG(KERN_DEBUG "raw v6 hw csum failure.\n");
                                skb->ip_summed = CHECKSUM_NONE;
                        }
                }