ipfilter: Fix checksum update for NAT_DIVERTOUT

When taking a snapshot of the before ip_len (s1) for comparison with the
after-translated ip_len (s2), we must convert it from network to host
byte order before we can use it. Add the missing ntohs() call.

PR:		296944
MFC after:	3 days
This commit is contained in:
Cy Schubert committed 2026-08-18 07:42:23 -07:00
1 parent 31f9f09bf7
commit c08a97fa27
1 file changed
+1 -1
+1 -1
View File
@@ -5147,7 +5147,7 @@ ipf_nat_out(fr_info_t *fin, nat_t *nat, int natadd, u_32_t nflags)
ip_fillid(ip, V_ip_random_id);
s2 = ntohs(ip->ip_id);
s1 = ip->ip_len;
s1 = ntohs(ip->ip_len);
ip->ip_len = ntohs(ip->ip_len);
ip->ip_len += fin->fin_plen;
ip->ip_len = htons(ip->ip_len);