mm: remove include/linux/bootmem.h
[linux-2.6-block.git] / net / ipv4 / udp.c
index cf8252d05a01a3a1e2f8116f92fa0953a22e965c..1976fddb9e00515072210c6bbcde929cb2832c73 100644 (file)
@@ -81,7 +81,7 @@
 
 #include <linux/uaccess.h>
 #include <asm/ioctls.h>
-#include <linux/bootmem.h>
+#include <linux/memblock.h>
 #include <linux/highmem.h>
 #include <linux/swap.h>
 #include <linux/types.h>
@@ -609,8 +609,8 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
        struct net *net = dev_net(skb->dev);
 
        sk = __udp4_lib_lookup(net, iph->daddr, uh->dest,
-                              iph->saddr, uh->source, skb->dev->ifindex, 0,
-                              udptable, NULL);
+                              iph->saddr, uh->source, skb->dev->ifindex,
+                              inet_sdif(skb), udptable, NULL);
        if (!sk) {
                __ICMP_INC_STATS(net, ICMP_MIB_INERRORS);
                return; /* No socket for error */
@@ -2120,8 +2120,24 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
        /* Note, we are only interested in != 0 or == 0, thus the
         * force to int.
         */
-       return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
-                                                        inet_compute_pseudo);
+       err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
+                                                       inet_compute_pseudo);
+       if (err)
+               return err;
+
+       if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) {
+               /* If SW calculated the value, we know it's bad */
+               if (skb->csum_complete_sw)
+                       return 1;
+
+               /* HW says the value is bad. Let's validate that.
+                * skb->csum is no longer the full packet checksum,
+                * so don't treat it as such.
+                */
+               skb_checksum_complete_unset(skb);
+       }
+
+       return 0;
 }
 
 /* wrapper for udp_queue_rcv_skb tacking care of csum conversion and