From 5df6cd2115098c2268aeb0701070a51434cdc85c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 19 Feb 2014 23:16:04 +0100 Subject: [PATCH] gtp: fix flags field for GTPv1 Now wireshark shows a well-formed GTPv1 message. --- gtp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gtp.c b/gtp.c index 8f0fa36..40ea3b5 100644 --- a/gtp.c +++ b/gtp.c @@ -462,7 +462,13 @@ gtp1_push_header(struct sk_buff *skb, struct pdp_ctx *pctx, int payload_len) skb_cow(skb, sizeof(*gtp1) + IP_UDP_LEN); gtp1 = (struct gtp1_header *) skb_push(skb, sizeof(*gtp1)); - gtp1->flags = 0x20; /* V1, GTP-non-prime */ + /* Bits 8 7 6 5 4 3 2 1 + * +--+--+--+--+--+--+--+--+ + * |version |PT| 1| E| S|PN| + * +--+--+--+--+--+--+--+--+ + * 0 0 1 1 1 0 0 0 + */ + gtp1->flags = 0x38; /* V1, GTP-non-prime */ gtp1->type = GTP_TPDU; gtp1->length = htons(payload_len); gtp1->tid = htonl((u32)pctx->tid);