Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jul 2011 12:55:01 +0000 (UTC)
From:      Daniel Eischen <deischen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r224281 - stable/8/sys/kern
Message-ID:  <201107231255.p6NCt14a062873@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: deischen
Date: Sat Jul 23 12:55:01 2011
New Revision: 224281
URL: http://svn.freebsd.org/changeset/base/224281

Log:
  MFC r218627
  
  Allow SO_SETFIB to select/set the default routing table.
  
  Requested by: Andrew Boyer aboyer at averesystems dot com.

Modified:
  stable/8/sys/kern/uipc_socket.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/uipc_socket.c
==============================================================================
--- stable/8/sys/kern/uipc_socket.c	Sat Jul 23 08:55:05 2011	(r224280)
+++ stable/8/sys/kern/uipc_socket.c	Sat Jul 23 12:55:01 2011	(r224281)
@@ -2490,15 +2490,16 @@ sosetopt(struct socket *so, struct socko
 		case SO_SETFIB:
 			error = sooptcopyin(sopt, &optval, sizeof optval,
 					    sizeof optval);
-			if (optval < 1 || optval > rt_numfibs) {
+			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_ROUTE)) {
+			if (so->so_proto != NULL &&
+			   ((so->so_proto->pr_domain->dom_family == PF_INET) ||
+			   (so->so_proto->pr_domain->dom_family == PF_ROUTE))) {
 				so->so_fibnum = optval;
 				/* Note: ignore error */
-				if (so->so_proto && so->so_proto->pr_ctloutput)
+				if (so->so_proto->pr_ctloutput)
 					(*so->so_proto->pr_ctloutput)(so, sopt);
 			} else {
 				so->so_fibnum = 0;



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