Skip to content

Commit ce82ecf

Browse files
committed
header_len redefined
1 parent 126e080 commit ce82ecf

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/services/pcn-pbforwarder/src/Pbforwarder_dp_parsing.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static __always_inline int handle_rx(struct CTXTYPE *ctx,
9999
pkt->srcPort = tcp->source;
100100
pkt->dstPort = tcp->dest;
101101
} else if (ip->protocol == IPPROTO_UDP) {
102+
uint8_t header_len = 4 * ip->ihl; //we have to redefine this to avoid errors
102103
udp = data + sizeof(*ethernet) + header_len;
103104
if (data + sizeof(*ethernet) + header_len + sizeof(*udp) > data_end)
104105
return RX_DROP;

0 commit comments

Comments
 (0)