Date: Fri, 10 Aug 2012 11:01:55 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r239173 - projects/pf/head/sys/contrib/pf/net Message-ID: <201208101101.q7AB1t0v025711@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Fri Aug 10 11:01:55 2012 New Revision: 239173 URL: http://svn.freebsd.org/changeset/base/239173 Log: Catch up with r238421 in pfsync. We need to initalize allocated keys. Reported by: Ben Wilber <ben desync.com> Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/if_pfsync.c Fri Aug 10 09:04:02 2012 (r239172) +++ projects/pf/head/sys/contrib/pf/net/if_pfsync.c Fri Aug 10 11:01:55 2012 (r239173) @@ -460,17 +460,23 @@ pfsync_state_import(struct pfsync_state if ((st = uma_zalloc(V_pf_state_z, M_NOWAIT | M_ZERO)) == NULL) goto cleanup; - if ((skw = uma_zalloc(V_pf_state_key_z, M_NOWAIT)) == NULL) + if ((skw = uma_zalloc(V_pf_state_key_z, M_NOWAIT | M_ZERO)) == NULL) goto cleanup; + TAILQ_INIT(&skw->states[PF_SK_WIRE]); + TAILQ_INIT(&skw->states[PF_SK_STACK]); + if (PF_ANEQ(&sp->key[PF_SK_WIRE].addr[0], &sp->key[PF_SK_STACK].addr[0], sp->af) || PF_ANEQ(&sp->key[PF_SK_WIRE].addr[1], &sp->key[PF_SK_STACK].addr[1], sp->af) || sp->key[PF_SK_WIRE].port[0] != sp->key[PF_SK_STACK].port[0] || sp->key[PF_SK_WIRE].port[1] != sp->key[PF_SK_STACK].port[1]) { - if ((sks = uma_zalloc(V_pf_state_key_z, M_NOWAIT)) == NULL) + sks = uma_zalloc(V_pf_state_key_z, M_NOWAIT | M_ZERO); + if (sks == NULL) goto cleanup; + TAILQ_INIT(&sks->states[PF_SK_WIRE]); + TAILQ_INIT(&sks->states[PF_SK_STACK]); } else sks = skw;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208101101.q7AB1t0v025711>