aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2007-12-03 06:34:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:48 -0500
commitb2bf1e2659b1cba5e65f81781cfd530be447f80b (patch)
treed7c3d2c10fe747a4d4ad7a54732e1d8e737c7556 /net/ipv6/udp.c
parentcb75994ec311b2cd50e5205efdcc0696abd6675d (diff)
[UDP]: Clean up for IS_UDPLITE macro
Since we have macro IS_UDPLITE, we can use it. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index b0474a618bbe..77ab31b99232 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -260,6 +260,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
260{ 260{
261 struct udp_sock *up = udp_sk(sk); 261 struct udp_sock *up = udp_sk(sk);
262 int rc; 262 int rc;
263 int is_udplite = IS_UDPLITE(sk);
263 264
264 if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) 265 if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
265 goto drop; 266 goto drop;
@@ -267,7 +268,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
267 /* 268 /*
268 * UDP-Lite specific tests, ignored on UDP sockets (see net/ipv4/udp.c). 269 * UDP-Lite specific tests, ignored on UDP sockets (see net/ipv4/udp.c).
269 */ 270 */
270 if ((up->pcflag & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) { 271 if ((is_udplite & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) {
271 272
272 if (up->pcrlen == 0) { /* full coverage was set */ 273 if (up->pcrlen == 0) { /* full coverage was set */
273 LIMIT_NETDEBUG(KERN_WARNING "UDPLITE6: partial coverage" 274 LIMIT_NETDEBUG(KERN_WARNING "UDPLITE6: partial coverage"
@@ -291,13 +292,13 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
291 if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) { 292 if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) {
292 /* Note that an ENOMEM error is charged twice */ 293 /* Note that an ENOMEM error is charged twice */
293 if (rc == -ENOMEM) 294 if (rc == -ENOMEM)
294 UDP6_INC_STATS_BH(UDP_MIB_RCVBUFERRORS, up->pcflag); 295 UDP6_INC_STATS_BH(UDP_MIB_RCVBUFERRORS, is_udplite);
295 goto drop; 296 goto drop;
296 } 297 }
297 298
298 return 0; 299 return 0;
299drop: 300drop:
300 UDP6_INC_STATS_BH(UDP_MIB_INERRORS, up->pcflag); 301 UDP6_INC_STATS_BH(UDP_MIB_INERRORS, is_udplite);
301 kfree_skb(skb); 302 kfree_skb(skb);
302 return -1; 303 return -1;
303} 304}
@@ -525,6 +526,7 @@ static int udp_v6_push_pending_frames(struct sock *sk)
525 struct inet_sock *inet = inet_sk(sk); 526 struct inet_sock *inet = inet_sk(sk);
526 struct flowi *fl = &inet->cork.fl; 527 struct flowi *fl = &inet->cork.fl;
527 int err = 0; 528 int err = 0;
529 int is_udplite = IS_UDPLITE(sk);
528 __wsum csum = 0; 530 __wsum csum = 0;
529 531
530 /* Grab the skbuff where UDP header space exists. */ 532 /* Grab the skbuff where UDP header space exists. */
@@ -540,7 +542,7 @@ static int udp_v6_push_pending_frames(struct sock *sk)
540 uh->len = htons(up->len); 542 uh->len = htons(up->len);
541 uh->check = 0; 543 uh->check = 0;
542 544
543 if (up->pcflag) 545 if (is_udplite)
544 csum = udplite_csum_outgoing(sk, skb); 546 csum = udplite_csum_outgoing(sk, skb);
545 else 547 else
546 csum = udp_csum_outgoing(sk, skb); 548 csum = udp_csum_outgoing(sk, skb);
@@ -556,7 +558,7 @@ out:
556 up->len = 0; 558 up->len = 0;
557 up->pending = 0; 559 up->pending = 0;
558 if (!err) 560 if (!err)
559 UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, up->pcflag); 561 UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite);
560 return err; 562 return err;
561} 563}
562 564
@@ -580,7 +582,7 @@ int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
580 int corkreq = up->corkflag || msg->msg_flags&MSG_MORE; 582 int corkreq = up->corkflag || msg->msg_flags&MSG_MORE;
581 int err; 583 int err;
582 int connected = 0; 584 int connected = 0;
583 int is_udplite = up->pcflag; 585 int is_udplite = IS_UDPLITE(sk);
584 int (*getfrag)(void *, char *, int, int, int, struct sk_buff *); 586 int (*getfrag)(void *, char *, int, int, int, struct sk_buff *);
585 587
586 /* destination address check */ 588 /* destination address check */