diff options
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index e671153b47b2..c47648892c04 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/ipv6.h> | 36 | #include <linux/ipv6.h> |
37 | #include <linux/icmpv6.h> | 37 | #include <linux/icmpv6.h> |
38 | #include <linux/init.h> | 38 | #include <linux/init.h> |
39 | #include <linux/skbuff.h> | ||
39 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
40 | 41 | ||
41 | #include <net/sock.h> | 42 | #include <net/sock.h> |
@@ -300,20 +301,7 @@ out: | |||
300 | return err; | 301 | return err; |
301 | 302 | ||
302 | csum_copy_err: | 303 | csum_copy_err: |
303 | /* Clear queue. */ | 304 | skb_kill_datagram(sk, skb, flags); |
304 | if (flags&MSG_PEEK) { | ||
305 | int clear = 0; | ||
306 | spin_lock_bh(&sk->sk_receive_queue.lock); | ||
307 | if (skb == skb_peek(&sk->sk_receive_queue)) { | ||
308 | __skb_unlink(skb, &sk->sk_receive_queue); | ||
309 | clear = 1; | ||
310 | } | ||
311 | spin_unlock_bh(&sk->sk_receive_queue.lock); | ||
312 | if (clear) | ||
313 | kfree_skb(skb); | ||
314 | } | ||
315 | |||
316 | skb_free_datagram(sk, skb); | ||
317 | 305 | ||
318 | if (flags & MSG_DONTWAIT) { | 306 | if (flags & MSG_DONTWAIT) { |
319 | UDP6_INC_STATS_USER(UDP_MIB_INERRORS); | 307 | UDP6_INC_STATS_USER(UDP_MIB_INERRORS); |
@@ -447,7 +435,7 @@ out: | |||
447 | read_unlock(&udp_hash_lock); | 435 | read_unlock(&udp_hash_lock); |
448 | } | 436 | } |
449 | 437 | ||
450 | static int udpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) | 438 | static int udpv6_rcv(struct sk_buff **pskb) |
451 | { | 439 | { |
452 | struct sk_buff *skb = *pskb; | 440 | struct sk_buff *skb = *pskb; |
453 | struct sock *sk; | 441 | struct sock *sk; |
@@ -771,7 +759,9 @@ do_udp_sendmsg: | |||
771 | } | 759 | } |
772 | if (opt == NULL) | 760 | if (opt == NULL) |
773 | opt = np->opt; | 761 | opt = np->opt; |
774 | opt = fl6_merge_options(&opt_space, flowlabel, opt); | 762 | if (flowlabel) |
763 | opt = fl6_merge_options(&opt_space, flowlabel, opt); | ||
764 | opt = ipv6_fixup_options(&opt_space, opt); | ||
775 | 765 | ||
776 | fl->proto = IPPROTO_UDP; | 766 | fl->proto = IPPROTO_UDP; |
777 | ipv6_addr_copy(&fl->fl6_dst, daddr); | 767 | ipv6_addr_copy(&fl->fl6_dst, daddr); |