diff options
Diffstat (limited to 'include/net/udplite.h')
-rw-r--r-- | include/net/udplite.h | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/include/net/udplite.h b/include/net/udplite.h index 67ac51424307..d99df75fe54c 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h | |||
@@ -47,11 +47,10 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh) | |||
47 | return 1; | 47 | return 1; |
48 | } | 48 | } |
49 | 49 | ||
50 | UDP_SKB_CB(skb)->partial_cov = 0; | ||
51 | cscov = ntohs(uh->len); | 50 | cscov = ntohs(uh->len); |
52 | 51 | ||
53 | if (cscov == 0) /* Indicates that full coverage is required. */ | 52 | if (cscov == 0) /* Indicates that full coverage is required. */ |
54 | cscov = skb->len; | 53 | ; |
55 | else if (cscov < 8 || cscov > skb->len) { | 54 | else if (cscov < 8 || cscov > skb->len) { |
56 | /* | 55 | /* |
57 | * Coverage length violates RFC 3828: log and discard silently. | 56 | * Coverage length violates RFC 3828: log and discard silently. |
@@ -60,42 +59,16 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh) | |||
60 | cscov, skb->len); | 59 | cscov, skb->len); |
61 | return 1; | 60 | return 1; |
62 | 61 | ||
63 | } else if (cscov < skb->len) | 62 | } else if (cscov < skb->len) { |
64 | UDP_SKB_CB(skb)->partial_cov = 1; | 63 | UDP_SKB_CB(skb)->partial_cov = 1; |
65 | 64 | UDP_SKB_CB(skb)->cscov = cscov; | |
66 | UDP_SKB_CB(skb)->cscov = cscov; | 65 | if (skb->ip_summed == CHECKSUM_COMPLETE) |
67 | 66 | skb->ip_summed = CHECKSUM_NONE; | |
68 | /* | 67 | } |
69 | * There is no known NIC manufacturer supporting UDP-Lite yet, | ||
70 | * hence ip_summed is always (re-)set to CHECKSUM_NONE. | ||
71 | */ | ||
72 | skb->ip_summed = CHECKSUM_NONE; | ||
73 | 68 | ||
74 | return 0; | 69 | return 0; |
75 | } | 70 | } |
76 | 71 | ||
77 | static __inline__ int udplite4_csum_init(struct sk_buff *skb, struct udphdr *uh) | ||
78 | { | ||
79 | int rc = udplite_checksum_init(skb, uh); | ||
80 | |||
81 | if (!rc) | ||
82 | skb->csum = csum_tcpudp_nofold(skb->nh.iph->saddr, | ||
83 | skb->nh.iph->daddr, | ||
84 | skb->len, IPPROTO_UDPLITE, 0); | ||
85 | return rc; | ||
86 | } | ||
87 | |||
88 | static __inline__ int udplite6_csum_init(struct sk_buff *skb, struct udphdr *uh) | ||
89 | { | ||
90 | int rc = udplite_checksum_init(skb, uh); | ||
91 | |||
92 | if (!rc) | ||
93 | skb->csum = ~csum_unfold(csum_ipv6_magic(&skb->nh.ipv6h->saddr, | ||
94 | &skb->nh.ipv6h->daddr, | ||
95 | skb->len, IPPROTO_UDPLITE, 0)); | ||
96 | return rc; | ||
97 | } | ||
98 | |||
99 | static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) | 72 | static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) |
100 | { | 73 | { |
101 | int cscov = up->len; | 74 | int cscov = up->len; |