pppolac: pull udp header before sock enqueue
pppolac driver incorrectly enqueues the packet into the sock queue without pulling UDP headers. The application will receive data along with UDP header when L2TP control packets are received. The issue was introduced after moving UDP header removal functionality from process rcvmesg context to BH context. Instead of pppolac driver directly queuing L2TP control packets into socket queue, return packet to udp_queue_rcv_skb, which will deliver the packet to the application after pulling the UDP header. Fixes: e6afc8ace ("udp: remove headers from UDP packets before queueing") Change-Id: Icfa0fd8da43ea9c14fa7c718746a6529651ac202 Signed-off-by: Tejaswi Tanikella <tejaswit@codeaurora.org> Signed-off-by: Chinmay Agarwal <chinagar@codeaurora.org> Acked-by: Sharath Chandra Vurukala <sharathv@qti.qualcomm.com>
This commit is contained in:
parent
6fe97939ba
commit
0560cec7c7
1 changed files with 4 additions and 3 deletions
|
@ -83,7 +83,7 @@ static int pppolac_recv_core(struct sock *sk_udp, struct sk_buff *skb)
|
|||
|
||||
/* Put it back if it is a control packet. */
|
||||
if (skb->data[sizeof(struct udphdr)] & L2TP_CONTROL_BIT)
|
||||
return opt->backlog_rcv(sk_udp, skb);
|
||||
return 2;
|
||||
|
||||
/* Skip UDP header. */
|
||||
skb_pull(skb, sizeof(struct udphdr));
|
||||
|
@ -190,9 +190,10 @@ drop:
|
|||
|
||||
static int pppolac_recv(struct sock *sk_udp, struct sk_buff *skb)
|
||||
{
|
||||
int retval;
|
||||
sock_hold(sk_udp);
|
||||
sk_receive_skb(sk_udp, skb, 0);
|
||||
return 0;
|
||||
retval = sk_receive_skb(sk_udp, skb, 0);
|
||||
return (retval >> 1);
|
||||
}
|
||||
|
||||
static struct sk_buff_head delivery_queue;
|
||||
|
|
Loading…
Add table
Reference in a new issue