Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Sep 2012 10:02:44 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240809 - head/sys/netpfil/pf
Message-ID:  <201209221002.q8MA2iAM042616@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Sat Sep 22 10:02:44 2012
New Revision: 240809
URL: http://svn.freebsd.org/changeset/base/240809

Log:
  Fix fallout from r236397 in pfr_update_stats(), that was missed
  later in r237155. We need to zero sockaddr before lookup. While
  here, make pfr_update_stats() panic on unknown af.

Modified:
  head/sys/netpfil/pf/pf_table.c

Modified: head/sys/netpfil/pf/pf_table.c
==============================================================================
--- head/sys/netpfil/pf/pf_table.c	Sat Sep 22 08:48:26 2012	(r240808)
+++ head/sys/netpfil/pf/pf_table.c	Sat Sep 22 10:02:44 2012	(r240809)
@@ -1954,6 +1954,7 @@ pfr_update_stats(struct pfr_ktable *kt, 
 	    {
 		struct sockaddr_in sin;
 
+		bzero(&sin, sizeof(sin));
 		sin.sin_len = sizeof(sin);
 		sin.sin_family = AF_INET;
 		sin.sin_addr.s_addr = a->addr32[0];
@@ -1968,6 +1969,7 @@ pfr_update_stats(struct pfr_ktable *kt, 
 	    {
 		struct sockaddr_in6 sin6;
 
+		bzero(&sin6, sizeof(sin6));
 		sin6.sin6_len = sizeof(sin6);
 		sin6.sin6_family = AF_INET6;
 		bcopy(a, &sin6.sin6_addr, sizeof(sin6.sin6_addr));
@@ -1978,7 +1980,7 @@ pfr_update_stats(struct pfr_ktable *kt, 
 	    }
 #endif /* INET6 */
 	default:
-		;
+		panic("%s: unknown address family %u", __func__, af);
 	}
 	if ((ke == NULL || ke->pfrke_not) != notrule) {
 		if (op_pass != PFR_OP_PASS)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209221002.q8MA2iAM042616>