summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2019-10-17 11:23:50 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2019-10-17 11:23:50 +0000
commitfeef698b98271f1dcda9486e1b38bcf4226f4d7c (patch)
tree6ae8c0f87d9ea7b4fac9f69699ab026e6b63b422 /sys/net/pf.c
parent45d493c4805c28bf97e836d65a28e9b31ac61fe6 (diff)
Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX.
This is clearer and more consistent with the rest of the kernel. OK deraadt@ sashan@
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 53205e0e6b1..5865554108a 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1089 2019/08/29 06:13:46 sashan Exp $ */
+/* $OpenBSD: pf.c,v 1.1090 2019/10/17 11:23:49 millert Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -3055,7 +3055,7 @@ pf_match_port(u_int8_t op, u_int16_t a1, u_int16_t a2, u_int16_t p)
int
pf_match_uid(u_int8_t op, uid_t a1, uid_t a2, uid_t u)
{
- if (u == UID_MAX && op != PF_OP_EQ && op != PF_OP_NE)
+ if (u == -1 && op != PF_OP_EQ && op != PF_OP_NE)
return (0);
return (pf_match(op, a1, a2, u));
}
@@ -3063,7 +3063,7 @@ pf_match_uid(u_int8_t op, uid_t a1, uid_t a2, uid_t u)
int
pf_match_gid(u_int8_t op, gid_t a1, gid_t a2, gid_t g)
{
- if (g == GID_MAX && op != PF_OP_EQ && op != PF_OP_NE)
+ if (g == -1 && op != PF_OP_EQ && op != PF_OP_NE)
return (0);
return (pf_match(op, a1, a2, g));
}
@@ -3225,8 +3225,8 @@ pf_socket_lookup(struct pf_pdesc *pd)
struct inpcbtable *tb;
struct inpcb *inp;
- pd->lookup.uid = UID_MAX;
- pd->lookup.gid = GID_MAX;
+ pd->lookup.uid = -1;
+ pd->lookup.gid = -1;
pd->lookup.pid = NO_PID;
switch (pd->virtual_proto) {
case IPPROTO_TCP:
@@ -6945,8 +6945,8 @@ pf_test(sa_family_t af, int fwdir, struct ifnet *ifp, struct mbuf **m0)
*/
if (fwdir == PF_FWD) {
pd.lookup.done = -1;
- pd.lookup.uid = UID_MAX;
- pd.lookup.gid = GID_MAX;
+ pd.lookup.uid = -1;
+ pd.lookup.gid = -1;
pd.lookup.pid = NO_PID;
}