Avoid undefined behavior.
The 'pktid' variable is modified while being used twice between sequence points, probably due to htonl() is macro. Reported by: PVS-Studio MFC after: 1 week
This commit is contained in:
parent
ba3e1361b0
commit
da62ffd9cd
@ -75,7 +75,8 @@ nat64stl_log(struct pfloghdr *plog, struct mbuf *m, sa_family_t family,
|
||||
plog->action = PF_NAT;
|
||||
plog->dir = PF_IN;
|
||||
plog->rulenr = htonl(kidx);
|
||||
plog->subrulenr = htonl(++pktid);
|
||||
pktid++;
|
||||
plog->subrulenr = htonl(pktid);
|
||||
plog->ruleset[0] = '\0';
|
||||
strlcpy(plog->ifname, "NAT64STL", sizeof(plog->ifname));
|
||||
ipfw_bpf_mtap2(plog, PFLOG_HDRLEN, m);
|
||||
|
Loading…
x
Reference in New Issue
Block a user