gtp: fix flags field for GTPv1

Now wireshark shows a well-formed GTPv1 message.
This commit is contained in:
Pablo Neira Ayuso 2014-02-19 23:16:04 +01:00
parent f33f89787b
commit 5df6cd2115
1 changed files with 7 additions and 1 deletions

8
gtp.c
View File

@ -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);