Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4c85bb2 authored by Devi Sandeep Endluri V V's avatar Devi Sandeep Endluri V V Committed by Gerrit - the friendly Code Review server
Browse files

l2tp_ppp: Fix Protocol in PPP Frame



protocol-field-compression is supported for PPP Frames. Therefore,
Protocol field has to be fixed before sending it to ppp driver.
Failing to do so, kernel retrieves 2 bytes and incorrectly
assumes that the protocol is incorrect and unsupported.

Check if the protocol is compressed, and fix it by pushing one
additional byte to skb.

CRs-Fixed: 2393404
Change-Id: Ia31806a29e038b5b7d8829498bf42491b94553df
Signed-off-by: default avatarDevi Sandeep Endluri V V <dendluri@codeaurora.org>
parent b8e4919b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -180,6 +180,12 @@ static int pppol2tp_recv_payload_hook(struct sk_buff *skb)
	if ((skb->data[0] == PPP_ALLSTATIONS) && (skb->data[1] == PPP_UI))
		skb_pull(skb, 2);

	if (skb->len >= 1 && skb->data[0] & 1)
		*(u8 *)skb_push(skb, 1) = 0;

	if (skb->len < 2)
		return 1;

	return 0;
}