bugfix: GTP-U only header no payload
This commit is contained in:
@@ -819,6 +819,19 @@ static inline const char *parse_gtp_u(struct packet *pkt, const char *data, uint
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hdr_len == len)
|
||||||
|
{
|
||||||
|
// only GTP-U header, no payload
|
||||||
|
struct layer_private *layer = get_free_layer(pkt);
|
||||||
|
if (unlikely(layer == NULL))
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
SET_LAYER(pkt, layer, LAYER_PROTO_GTP_U, hdr_len, data, len, 0);
|
||||||
|
return layer->pld_ptr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
uint8_t next_proto = (((const uint8_t *)(data + hdr_len))[0]) >> 4;
|
uint8_t next_proto = (((const uint8_t *)(data + hdr_len))[0]) >> 4;
|
||||||
if (next_proto != 4 && next_proto != 6)
|
if (next_proto != 4 && next_proto != 6)
|
||||||
{
|
{
|
||||||
@@ -843,6 +856,7 @@ static inline const char *parse_gtp_u(struct packet *pkt, const char *data, uint
|
|||||||
PACKET_LOG_UNSUPPORT_PROTO(pkt, LAYER_PROTO_GTP_U, next_proto);
|
PACKET_LOG_UNSUPPORT_PROTO(pkt, LAYER_PROTO_GTP_U, next_proto);
|
||||||
return layer->pld_ptr;
|
return layer->pld_ptr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const char *parse_gtp_c(struct packet *pkt, const char *data, uint16_t len)
|
static inline const char *parse_gtp_c(struct packet *pkt, const char *data, uint16_t len)
|
||||||
|
|||||||
Reference in New Issue
Block a user