Apply a patch from OPENBSD_3_6 branch (ok yamt).

MFC:
Fix by mcbride@

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 mcbride@ dhartmei@ deraadt@ henning@
This commit is contained in:
peter 2004-12-21 12:05:34 +00:00
parent e5653b8213
commit e71187380f
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* $NetBSD: pf.c,v 1.9 2004/12/21 05:55:23 yamt Exp $ */
/* $OpenBSD: pf.c,v 1.457.2.4 2004/11/28 06:21:44 brad Exp $ */
/* $NetBSD: pf.c,v 1.10 2004/12/21 12:05:34 peter Exp $ */
/* $OpenBSD: pf.c,v 1.457.2.5 2004/12/16 02:04:55 brad Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@ -2012,6 +2012,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;
}