]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/udplite.h
[LLC]: Kill llc_set_pdu_hdr
[karo-tx-linux.git] / include / net / udplite.h
index 406eb755b34ec81b2a1f59371b539a66b7515b84..d99df75fe54c51fa5d96899585ece186e3bc680d 100644 (file)
@@ -4,6 +4,8 @@
 #ifndef _UDPLITE_H
 #define _UDPLITE_H
 
+#include <net/ip6_checksum.h>
+
 /* UDP-Lite socket options */
 #define UDPLITE_SEND_CSCOV   10 /* sender partial coverage (as sent)      */
 #define UDPLITE_RECV_CSCOV   11 /* receiver partial coverage (threshold ) */
@@ -45,11 +47,10 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
                return 1;
        }
 
-        UDP_SKB_CB(skb)->partial_cov = 0;
        cscov = ntohs(uh->len);
 
        if (cscov == 0)          /* Indicates that full coverage is required. */
-               cscov = skb->len;
+               ;
        else if (cscov < 8  || cscov > skb->len) {
                /*
                 * Coverage length violates RFC 3828: log and discard silently.
@@ -58,42 +59,16 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
                               cscov, skb->len);
                return 1;
 
-       } else if (cscov < skb->len)
+       } else if (cscov < skb->len) {
                UDP_SKB_CB(skb)->partial_cov = 1;
-
-        UDP_SKB_CB(skb)->cscov = cscov;
-
-       /*
-        * There is no known NIC manufacturer supporting UDP-Lite yet,
-        * hence ip_summed is always (re-)set to CHECKSUM_NONE.
-        */
-       skb->ip_summed = CHECKSUM_NONE;
+               UDP_SKB_CB(skb)->cscov = cscov;
+               if (skb->ip_summed == CHECKSUM_COMPLETE)
+                       skb->ip_summed = CHECKSUM_NONE;
+        }
 
        return 0;
 }
 
-static __inline__ int udplite4_csum_init(struct sk_buff *skb, struct udphdr *uh)
-{
-       int rc = udplite_checksum_init(skb, uh);
-
-       if (!rc)
-               skb->csum = csum_tcpudp_nofold(skb->nh.iph->saddr,
-                                              skb->nh.iph->daddr,
-                                              skb->len, IPPROTO_UDPLITE, 0);
-       return rc;
-}
-
-static __inline__ int udplite6_csum_init(struct sk_buff *skb, struct udphdr *uh)
-{
-       int rc = udplite_checksum_init(skb, uh);
-
-       if (!rc)
-               skb->csum = ~csum_ipv6_magic(&skb->nh.ipv6h->saddr,
-                                            &skb->nh.ipv6h->daddr,
-                                            skb->len, IPPROTO_UDPLITE, 0);
-       return rc;
-}
-
 static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
 {
        int cscov = up->len;