Napatech: Fix network byte order when comparing addresses

This fixes an issue where the "endieness" was not properly accounted for
when comparing two IPv4 addresses to be sorted.
pull/5012/head
Phil Young 5 years ago committed by Victor Julien
parent d1d09ecfa8
commit 3ccd44b144

@ -457,7 +457,7 @@ static int ProgramFlow(Packet *p, int is_inline)
v4Tuple.sa = pIPv4_hdr->src_addr;
v4Tuple.da = pIPv4_hdr->dst_addr;
} else {
do_swap = (pIPv4_hdr->src_addr > pIPv4_hdr->dst_addr);
do_swap = (htonl(pIPv4_hdr->src_addr) > htonl(pIPv4_hdr->dst_addr));
if (!do_swap) {
/* already in order */
v4Tuple.sa = pIPv4_hdr->src_addr;

Loading…
Cancel
Save