udp: remove headers from UDP packets before queueing
Remove UDP transport headers before queueing packets for reception. This change simplifies a follow-up patch to add MSG_PEEK support. Signed-off-by: Sam Kumar <samanthakumar@google.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b9bb53f383
commit
e6afc8ace6
@ -402,9 +402,8 @@ static void sock_disable_timestamp(struct sock *sk, unsigned long flags)
|
||||
}
|
||||
|
||||
|
||||
int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
int err;
|
||||
unsigned long flags;
|
||||
struct sk_buff_head *list = &sk->sk_receive_queue;
|
||||
|
||||
@ -414,10 +413,6 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
err = sk_filter(sk, skb);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!sk_rmem_schedule(sk, skb, skb->truesize)) {
|
||||
atomic_inc(&sk->sk_drops);
|
||||
return -ENOBUFS;
|
||||
@ -440,6 +435,18 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
sk->sk_data_ready(sk);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(__sock_queue_rcv_skb);
|
||||
|
||||
int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = sk_filter(sk, skb);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return __sock_queue_rcv_skb(sk, skb);
|
||||
}
|
||||
EXPORT_SYMBOL(sock_queue_rcv_skb);
|
||||
|
||||
int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
|
||||
|
||||
Reference in New Issue
Block a user