mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
gtp: reload GTPv1 header after pskb_may_pull()
The GTPv1 header flags indicate the presence of optional extensions
after this header. Refresh the pointer to the GTPv1 header as skb->head
might have be reallocated via pskb_may_pull().
Fixes: 459aa660eb
("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1dee3f59a8
commit
93edb8c7f9
1 changed files with 2 additions and 0 deletions
|
@ -253,6 +253,8 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
|
||||||
if (!pskb_may_pull(skb, hdrlen))
|
if (!pskb_may_pull(skb, hdrlen))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr));
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid));
|
pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid));
|
||||||
if (!pctx) {
|
if (!pctx) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue