Commit f7cef43a authored by Vincenzo Maffione's avatar Vincenzo Maffione
Browse files

nemtap: lb app: Validate ihl field when hashing packet

MFC after:	1 week
parent 8771ff75
......@@ -150,7 +150,9 @@ decode_ip_n_hash(const struct ip *iph, uint8_t hash_split, uint8_t seed)
{
uint32_t rc = 0;
if (hash_split == 2) {
if (iph->ip_hl < 5 || iph->ip_hl * 4 > iph->ip_len) {
rc = 0;
} else if (hash_split == 2) {
rc = sym_hash_fn(ntohl(iph->ip_src.s_addr),
ntohl(iph->ip_dst.s_addr),
ntohs(0xFFFD) + seed,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment