diff options
author | Pablo Neira <pablo@netfilter.org> | 2016-05-10 15:33:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-10 15:56:23 -0400 |
commit | 93edb8c7f94fb3d384790ac8a83c3fb9389f6ca5 (patch) | |
tree | 76baacecad6ebd442b864df240b9ed5224107e41 /drivers/net/gtp.c | |
parent | 1dee3f59a8d5e711797dc82628aaf94a64e99922 (diff) |
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: 459aa660eb1d ("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>
Diffstat (limited to 'drivers/net/gtp.c')
-rw-r--r-- | drivers/net/gtp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 8ce1104e4fdb..f7caf1e35d83 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c | |||
@@ -253,6 +253,8 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb, | |||
253 | if (!pskb_may_pull(skb, hdrlen)) | 253 | if (!pskb_may_pull(skb, hdrlen)) |
254 | return -1; | 254 | return -1; |
255 | 255 | ||
256 | gtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr)); | ||
257 | |||
256 | rcu_read_lock(); | 258 | rcu_read_lock(); |
257 | pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); | 259 | pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid)); |
258 | if (!pctx) { | 260 | if (!pctx) { |