diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 2422a5f7195d..012c4621e40a 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -846,20 +846,7 @@ out: | |||
846 | csum_copy_err: | 846 | csum_copy_err: |
847 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 847 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
848 | 848 | ||
849 | /* Clear queue. */ | 849 | skb_kill_datagram(sk, skb, flags); |
850 | if (flags&MSG_PEEK) { | ||
851 | int clear = 0; | ||
852 | spin_lock_bh(&sk->sk_receive_queue.lock); | ||
853 | if (skb == skb_peek(&sk->sk_receive_queue)) { | ||
854 | __skb_unlink(skb, &sk->sk_receive_queue); | ||
855 | clear = 1; | ||
856 | } | ||
857 | spin_unlock_bh(&sk->sk_receive_queue.lock); | ||
858 | if (clear) | ||
859 | kfree_skb(skb); | ||
860 | } | ||
861 | |||
862 | skb_free_datagram(sk, skb); | ||
863 | 850 | ||
864 | if (noblock) | 851 | if (noblock) |
865 | return -EAGAIN; | 852 | return -EAGAIN; |