Date: Thu, 11 Oct 2012 21:15:54 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241462 - stable/9/sys/kern Message-ID: <201210112115.q9BLFsg2086930@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Thu Oct 11 21:15:54 2012 New Revision: 241462 URL: http://svn.freebsd.org/changeset/base/241462 Log: MFC r233850: - Remove redundant call to pr_ctloutput from code that handles SO_SETFIB. - Add a check for errors during copyin while here. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Thu Oct 11 20:53:11 2012 (r241461) +++ stable/9/sys/kern/uipc_socket.c Thu Oct 11 21:15:54 2012 (r241462) @@ -2498,20 +2498,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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210112115.q9BLFsg2086930>