Skip to content

Commit a1b460b

Browse files
committed
pflog: check against UINT_MAX, not UID_MAX.
We want a value that's not OS-dependent and that's defined.
1 parent cee704e commit a1b460b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

print-pflog.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr)
247247

248248
ND_PRINT("%s", tok2str(pf_reasons, "unkn(%u)", GET_U_1(hdr->reason)));
249249

250-
if (GET_BE_U_4(hdr->uid) != UID_MAX)
250+
/*
251+
* All bits set means that the UID shouldn't be printed.
252+
* That's UINT_MAX if signed, or -1 if unsigned.
253+
*/
254+
if (GET_BE_U_4(hdr->uid) != UINT_MAX)
251255
ND_PRINT(" [uid %u]", GET_BE_U_4(hdr->uid));
252256

253257
#if defined(__FreeBSD__)

0 commit comments

Comments
 (0)