sctp6_usrreq.c (233005) | sctp6_usrreq.c (235360) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2011, 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 * --- 18 unchanged lines hidden (view full) --- 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/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2011, 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 * --- 18 unchanged lines hidden (view full) --- 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/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 233005 2012-03-15 14:22:05Z tuexen $"); | 35__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 235360 2012-05-12 20:11:35Z tuexen $"); |
36 37#include <netinet/sctp_os.h> 38#include <sys/proc.h> 39#include <netinet/sctp_pcb.h> 40#include <netinet/sctp_header.h> 41#include <netinet/sctp_var.h> 42#if defined(INET6) 43#include <netinet6/sctp6_var.h> --- 339 unchanged lines hidden (view full) --- 383 struct sockaddr *to, 384 struct sctp_tcb *stcb, 385 struct sctp_nets *net) 386{ 387#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 388 struct socket *so; 389 390#endif | 36 37#include <netinet/sctp_os.h> 38#include <sys/proc.h> 39#include <netinet/sctp_pcb.h> 40#include <netinet/sctp_header.h> 41#include <netinet/sctp_var.h> 42#if defined(INET6) 43#include <netinet6/sctp6_var.h> --- 339 unchanged lines hidden (view full) --- 383 struct sockaddr *to, 384 struct sctp_tcb *stcb, 385 struct sctp_nets *net) 386{ 387#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 388 struct socket *so; 389 390#endif |
391 /* protection */ 392 int reason; | |
393 | 391 |
394 | 392 /* protection */ |
395 if ((inp == NULL) || (stcb == NULL) || (net == NULL) || 396 (sh == NULL) || (to == NULL)) { 397 if (stcb) 398 SCTP_TCB_UNLOCK(stcb); 399 return; 400 } 401 /* First job is to verify the vtag matches what I would send */ 402 if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) { --- 33 unchanged lines hidden (view full) --- 436 (icmph->icmp6_code == ICMP_UNREACH_PORT)) { 437 /* 438 * Here the peer is either playing tricks on us, including 439 * an address that belongs to someone who does not support 440 * SCTP OR was a userland implementation that shutdown and 441 * now is dead. In either case treat it like a OOTB abort 442 * with no TCB 443 */ | 393 if ((inp == NULL) || (stcb == NULL) || (net == NULL) || 394 (sh == NULL) || (to == NULL)) { 395 if (stcb) 396 SCTP_TCB_UNLOCK(stcb); 397 return; 398 } 399 /* First job is to verify the vtag matches what I would send */ 400 if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) { --- 33 unchanged lines hidden (view full) --- 434 (icmph->icmp6_code == ICMP_UNREACH_PORT)) { 435 /* 436 * Here the peer is either playing tricks on us, including 437 * an address that belongs to someone who does not support 438 * SCTP OR was a userland implementation that shutdown and 439 * now is dead. In either case treat it like a OOTB abort 440 * with no TCB 441 */ |
444 reason = SCTP_PEER_FAULTY; 445 sctp_abort_notification(stcb, reason, SCTP_SO_NOT_LOCKED); | 442 sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); |
446#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 447 so = SCTP_INP_SO(inp); 448 atomic_add_int(&stcb->asoc.refcnt, 1); 449 SCTP_TCB_UNLOCK(stcb); 450 SCTP_SOCKET_LOCK(so, 1); 451 SCTP_TCB_LOCK(stcb); 452 atomic_subtract_int(&stcb->asoc.refcnt, 1); 453#endif --- 898 unchanged lines hidden --- | 443#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 444 so = SCTP_INP_SO(inp); 445 atomic_add_int(&stcb->asoc.refcnt, 1); 446 SCTP_TCB_UNLOCK(stcb); 447 SCTP_SOCKET_LOCK(so, 1); 448 SCTP_TCB_LOCK(stcb); 449 atomic_subtract_int(&stcb->asoc.refcnt, 1); 450#endif --- 898 unchanged lines hidden --- |