aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
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 */