summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-12-14 03:49:07 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-12-14 03:49:07 +0000
commit7c5e8ad8d878ab090fc04366dec83153db2adf6b (patch)
treed215d5885d51b197ca1e4578b079b8845111a6b5 /sys/net/pf.c
parent3a51d59a2ac34de996f7e741c04893bd81a472ca (diff)
Initialise init_addr in pf_map_addr() in the PF_POOL_ROUNDROBIN,
prevents a possible endless loop in pf_get_sport() with 'static-port' Reported by adm at celeritystorm dot com in FreeBSD PR74930, debugging by dhartmei@ ok dhartmei@
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index c11aa5d0c63..9260c7eac24 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.473 2004/12/11 11:45:44 mpf Exp $ */
+/* $OpenBSD: pf.c,v 1.474 2004/12/14 03:49:06 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2122,6 +2122,8 @@ pf_map_addr(sa_family_t af, struct pf_rule *r, struct pf_addr *saddr,
get_addr:
PF_ACPY(naddr, &rpool->counter, af);
+ if (init_addr != NULL && PF_AZERO(init_addr, af))
+ PF_ACPY(init_addr, naddr, af);
PF_AINC(&rpool->counter, af);
break;
}