[NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
[pandora-kernel.git] / net / ipv4 / udp.c
index 3f93292..8715251 100644 (file)
@@ -91,7 +91,6 @@
 #include <linux/errno.h>
 #include <linux/timer.h>
 #include <linux/mm.h>
-#include <linux/config.h>
 #include <linux/inet.h>
 #include <linux/ipv6.h>
 #include <linux/netdevice.h>
@@ -430,7 +429,7 @@ static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up)
                /*
                 * Only one fragment on the socket.
                 */
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        skb->csum = offsetof(struct udphdr, check);
                        uh->check = ~csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst,
                                        up->len, IPPROTO_UDP, 0);
@@ -449,7 +448,7 @@ static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up)
                 * fragments on the socket so that all csums of sk_buffs
                 * should be together.
                 */
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        int offset = (unsigned char *)uh - skb->data;
                        skb->csum = skb_checksum(skb, offset, skb->len - offset, 0);
 
@@ -604,6 +603,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                                    .uli_u = { .ports =
                                               { .sport = inet->sport,
                                                 .dport = dport } } };
+               security_sk_classify_flow(sk, &fl);
                err = ip_route_output_flow(&rt, &fl, sk, !(msg->msg_flags&MSG_DONTWAIT));
                if (err)
                        goto out;
@@ -1088,7 +1088,7 @@ static void udp_checksum_init(struct sk_buff *skb, struct udphdr *uh,
 {
        if (uh->check == 0) {
                skb->ip_summed = CHECKSUM_UNNECESSARY;
-       } else if (skb->ip_summed == CHECKSUM_HW) {
+       } else if (skb->ip_summed == CHECKSUM_COMPLETE) {
                if (!udp_check(uh, ulen, saddr, daddr, skb->csum))
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
        }
@@ -1469,11 +1469,10 @@ static int udp_seq_open(struct inode *inode, struct file *file)
        struct udp_seq_afinfo *afinfo = PDE(inode)->data;
        struct seq_file *seq;
        int rc = -ENOMEM;
-       struct udp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
+       struct udp_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
 
        if (!s)
                goto out;
-       memset(s, 0, sizeof(*s));
        s->family               = afinfo->family;
        s->seq_ops.start        = udp_seq_start;
        s->seq_ops.next         = udp_seq_next;