sctp_usrreq.c (284440) | sctp_usrreq.c (284633) |
---|---|
1/*- 2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: stable/10/sys/netinet/sctp_usrreq.c 284440 2015-06-16 08:26:33Z tuexen $"); | 34__FBSDID("$FreeBSD: stable/10/sys/netinet/sctp_usrreq.c 284633 2015-06-20 08:25:27Z tuexen $"); |
35 36#include <netinet/sctp_os.h> 37#include <sys/proc.h> 38#include <netinet/sctp_pcb.h> 39#include <netinet/sctp_header.h> 40#include <netinet/sctp_var.h> 41#ifdef INET6 42#include <netinet6/sctp6_var.h> --- 6664 unchanged lines hidden (view full) --- 6707 6708int 6709sctp_ctloutput(struct socket *so, struct sockopt *sopt) 6710{ 6711 void *optval = NULL; 6712 size_t optsize = 0; 6713 void *p; 6714 int error = 0; | 35 36#include <netinet/sctp_os.h> 37#include <sys/proc.h> 38#include <netinet/sctp_pcb.h> 39#include <netinet/sctp_header.h> 40#include <netinet/sctp_var.h> 41#ifdef INET6 42#include <netinet6/sctp6_var.h> --- 6664 unchanged lines hidden (view full) --- 6707 6708int 6709sctp_ctloutput(struct socket *so, struct sockopt *sopt) 6710{ 6711 void *optval = NULL; 6712 size_t optsize = 0; 6713 void *p; 6714 int error = 0; |
6715 struct sctp_inpcb *inp; |
|
6715 | 6716 |
6717 if ((sopt->sopt_level == SOL_SOCKET) && 6718 (sopt->sopt_name == SO_SETFIB)) { 6719 inp = (struct sctp_inpcb *)so->so_pcb; 6720 if (inp == NULL) { 6721 SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS); 6722 return (EINVAL); 6723 } 6724 SCTP_INP_WLOCK(inp); 6725 inp->fibnum = so->so_fibnum; 6726 SCTP_INP_WUNLOCK(inp); 6727 return (0); 6728 } |
|
6716 if (sopt->sopt_level != IPPROTO_SCTP) { 6717 /* wrong proto level... send back up to IP */ 6718#ifdef INET6 6719 if (INP_CHECK_SOCKAF(so, AF_INET6)) 6720 error = ip6_ctloutput(so, sopt); 6721#endif /* INET6 */ 6722#if defined(INET) && defined(INET6) 6723 else --- 652 unchanged lines hidden --- | 6729 if (sopt->sopt_level != IPPROTO_SCTP) { 6730 /* wrong proto level... send back up to IP */ 6731#ifdef INET6 6732 if (INP_CHECK_SOCKAF(so, AF_INET6)) 6733 error = ip6_ctloutput(so, sopt); 6734#endif /* INET6 */ 6735#if defined(INET) && defined(INET6) 6736 else --- 652 unchanged lines hidden --- |