Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2012 08:37:12 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r233864 - in projects/pf/head: contrib/pf/pfctl sys/kern usr.bin/netstat
Message-ID:  <201204040837.q348bCvp093435@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Apr  4 08:37:12 2012
New Revision: 233864
URL: http://svn.freebsd.org/changeset/base/233864

Log:
  Merge head r233849 through r233863.

Modified:
  projects/pf/head/contrib/pf/pfctl/pf_print_state.c
  projects/pf/head/sys/kern/uipc_socket.c
  projects/pf/head/usr.bin/netstat/if.c
Directory Properties:
  projects/pf/head/   (props changed)
  projects/pf/head/sys/   (props changed)

Modified: projects/pf/head/contrib/pf/pfctl/pf_print_state.c
==============================================================================
--- projects/pf/head/contrib/pf/pfctl/pf_print_state.c	Wed Apr  4 08:30:32 2012	(r233863)
+++ projects/pf/head/contrib/pf/pfctl/pf_print_state.c	Wed Apr  4 08:37:12 2012	(r233864)
@@ -306,6 +306,9 @@ print_state(struct pfsync_state *s, int 
 		u_int32_t creation = ntohl(s->creation);
 		u_int32_t expire = ntohl(s->expire);
 
+		printf("   id %lu", be64toh((uint64_t)s->id));
+		printf(", age %u", creation);
+		printf(", expires %u\n", expire);
 		sec = creation % 60;
 		creation /= 60;
 		min = creation % 60;

Modified: projects/pf/head/sys/kern/uipc_socket.c
==============================================================================
--- projects/pf/head/sys/kern/uipc_socket.c	Wed Apr  4 08:30:32 2012	(r233863)
+++ projects/pf/head/sys/kern/uipc_socket.c	Wed Apr  4 08:37:12 2012	(r233864)
@@ -2504,20 +2504,19 @@ sosetopt(struct socket *so, struct socko
 		case SO_SETFIB:
 			error = sooptcopyin(sopt, &optval, sizeof optval,
 					    sizeof optval);
+			if (error)
+				goto bad;
+
 			if (optval < 0 || optval >= rt_numfibs) {
 				error = EINVAL;
 				goto bad;
 			}
 			if (((so->so_proto->pr_domain->dom_family == PF_INET) ||
 			   (so->so_proto->pr_domain->dom_family == PF_INET6) ||
-			   (so->so_proto->pr_domain->dom_family == PF_ROUTE))) {
+			   (so->so_proto->pr_domain->dom_family == PF_ROUTE)))
 				so->so_fibnum = optval;
-				/* Note: ignore error */
-				if (so->so_proto->pr_ctloutput)
-					(*so->so_proto->pr_ctloutput)(so, sopt);
-			} else {
+			else
 				so->so_fibnum = 0;
-			}
 			break;
 
 		case SO_USER_COOKIE:

Modified: projects/pf/head/usr.bin/netstat/if.c
==============================================================================
--- projects/pf/head/usr.bin/netstat/if.c	Wed Apr  4 08:30:32 2012	(r233863)
+++ projects/pf/head/usr.bin/netstat/if.c	Wed Apr  4 08:37:12 2012	(r233864)
@@ -93,10 +93,10 @@ pfsync_stats(u_long off, const char *nam
 	if (live) {
 		if (zflag)
 			memset(&zerostat, 0, len);
-		if (sysctlbyname("net.inet.pfsync.stats", &pfsyncstat, &len,
+		if (sysctlbyname("net.pfsync.stats", &pfsyncstat, &len,
 		    zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
 			if (errno != ENOENT)
-				warn("sysctl: net.inet.pfsync.stats");
+				warn("sysctl: net.pfsync.stats");
 			return;
 		}
 	} else



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