From 516a76f46c1191d7b4dfdcffef3bec6439d23432 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 31 Jan 2014 23:44:46 +0100 Subject: [PATCH] gtp: fix wrong endianess conversion in gtpv0 seq field While at it, also set to 0xff the spare bytes as the specs indicates. --- gtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtp.c b/gtp.c index 0f9e59b..e06c1e3 100644 --- a/gtp.c +++ b/gtp.c @@ -423,10 +423,10 @@ gtp0_push_header(struct sk_buff *skb, struct pdp_ctx *pctx, int payload_len) gtp0->flags = 0x1e; /* V0, GTP-non-prime */ gtp0->type = GTP_TPDU; gtp0->length = htons(payload_len); - gtp0->seq = htonl(atomic_inc_return(&pctx->tx_seq) % 0xffff); + gtp0->seq = htons(atomic_inc_return(&pctx->tx_seq) % 0xffff); gtp0->flow = htonl(pctx->flow); gtp0->number = 0xFF; - gtp0->spare[0] = gtp0->spare[1] = gtp0->spare[2] = 0; + gtp0->spare[0] = gtp0->spare[1] = gtp0->spare[2] = 0xFF; gtp0->tid = cpu_to_be64(pctx->tid); }