aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/udplite.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/udplite.h')
-rw-r--r--include/net/udplite.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/udplite.h b/include/net/udplite.h
index b76b2e377af4..01ddb2c20264 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -25,7 +25,9 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
25/* Designate sk as UDP-Lite socket */ 25/* Designate sk as UDP-Lite socket */
26static inline int udplite_sk_init(struct sock *sk) 26static inline int udplite_sk_init(struct sock *sk)
27{ 27{
28#ifdef CONFIG_IP_UDPLITE
28 udp_sk(sk)->pcflag = UDPLITE_BIT; 29 udp_sk(sk)->pcflag = UDPLITE_BIT;
30#endif
29 return 0; 31 return 0;
30} 32}
31 33
@@ -69,7 +71,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
69static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) 71static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
70{ 72{
71 int cscov = up->len; 73 int cscov = up->len;
72 74#ifdef CONFIG_IP_UDPLITE
73 /* 75 /*
74 * Sender has set `partial coverage' option on UDP-Lite socket 76 * Sender has set `partial coverage' option on UDP-Lite socket
75 */ 77 */
@@ -93,13 +95,15 @@ static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)
93 * illegal, we fall back to the defaults here. 95 * illegal, we fall back to the defaults here.
94 */ 96 */
95 } 97 }
98#endif
96 return cscov; 99 return cscov;
97} 100}
98 101
99static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) 102static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
100{ 103{
101 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
102 __wsum csum = 0; 104 __wsum csum = 0;
105#ifdef CONFIG_IP_UDPLITE
106 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
103 107
104 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 108 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
105 109
@@ -112,6 +116,7 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
112 if ((cscov -= len) <= 0) 116 if ((cscov -= len) <= 0)
113 break; 117 break;
114 } 118 }
119#endif
115 return csum; 120 return csum;
116} 121}
117 122