]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/ipv4/udp.c
[UDP]: Defer InDataGrams increment until recvmsg() does checksum
[mv-sheeva.git] / net / ipv4 / udp.c
index 4bc25b46f33ff9138512e5da915d01007048e9d0..3465d4ad301be911a023e68521229e35705c1279 100644 (file)
@@ -873,6 +873,8 @@ try_again:
        if (err)
                goto out_free;
 
+       UDP_INC_STATS_USER(UDP_MIB_INDATAGRAMS, is_udplite);
+
        sock_recv_timestamp(msg, sk, skb);
 
        /* Copy the address. */
@@ -966,10 +968,8 @@ int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
                        int ret;
 
                        ret = (*up->encap_rcv)(sk, skb);
-                       if (ret <= 0) {
-                               UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, up->pcflag);
+                       if (ret <= 0)
                                return -ret;
-                       }
                }
 
                /* FALLTHROUGH -- it's a UDP Packet */
@@ -1023,7 +1023,6 @@ int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
                goto drop;
        }
 
-       UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS, up->pcflag);
        return 0;
 
 drop:
@@ -1430,6 +1429,8 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
 
 }
 
+DEFINE_PROTO_INUSE(udp)
+
 struct proto udp_prot = {
        .name              = "UDP",
        .owner             = THIS_MODULE,
@@ -1452,6 +1453,7 @@ struct proto udp_prot = {
        .compat_setsockopt = compat_udp_setsockopt,
        .compat_getsockopt = compat_udp_getsockopt,
 #endif
+       REF_PROTO_INUSE(udp)
 };
 
 /* ------------------------------------------------------------------------ */