From owner-svn-src-stable-7@FreeBSD.ORG Wed Aug 17 14:29:33 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F921065670; Wed, 17 Aug 2011 14:29:33 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6580C8FC17; Wed, 17 Aug 2011 14:29:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7HETXoW009108; Wed, 17 Aug 2011 14:29:33 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7HETXEF009106; Wed, 17 Aug 2011 14:29:33 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201108171429.p7HETXEF009106@svn.freebsd.org> From: Daniel Eischen Date: Wed, 17 Aug 2011 14:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224941 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2011 14:29:33 -0000 Author: deischen Date: Wed Aug 17 14:29:33 2011 New Revision: 224941 URL: http://svn.freebsd.org/changeset/base/224941 Log: MFC r218627 Allow SO_SETFIB to select/set the default routing table. Requested by: Andrew Boyer aboyer at averesystems dot com. Modified: stable/7/sys/kern/uipc_socket.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Wed Aug 17 14:28:58 2011 (r224940) +++ stable/7/sys/kern/uipc_socket.c Wed Aug 17 14:29:33 2011 (r224941) @@ -2207,15 +2207,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;