Deleted Added
full compact
sctp_usrreq.c (237565) sctp_usrreq.c (237715)
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: head/sys/netinet/sctp_usrreq.c 237565 2012-06-25 17:15:09Z tuexen $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 237715 2012-06-28 16:01:08Z 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#if defined(INET6)
42#endif

--- 297 unchanged lines hidden (view full) ---

340 to.sin_port = sh->dest_port;
341 to.sin_addr = ip->ip_dst;
342
343 /*
344 * 'to' holds the dest of the packet that failed to be sent.
345 * 'from' holds our local endpoint address. Thus we reverse
346 * the to and the from in the lookup.
347 */
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#if defined(INET6)
42#endif

--- 297 unchanged lines hidden (view full) ---

340 to.sin_port = sh->dest_port;
341 to.sin_addr = ip->ip_dst;
342
343 /*
344 * 'to' holds the dest of the packet that failed to be sent.
345 * 'from' holds our local endpoint address. Thus we reverse
346 * the to and the from in the lookup.
347 */
348 stcb = sctp_findassociation_addr_sa((struct sockaddr *)&from,
349 (struct sockaddr *)&to,
348 stcb = sctp_findassociation_addr_sa((struct sockaddr *)&to,
349 (struct sockaddr *)&from,
350 &inp, &net, 1, vrf_id);
351 if (stcb != NULL && inp && (inp->sctp_socket != NULL)) {
352 if (cmd != PRC_MSGSIZE) {
353 sctp_notify(inp, ip, sh,
354 (struct sockaddr *)&to, stcb,
355 net);
356 } else {
357 /* handle possible ICMP size messages */

--- 34 unchanged lines hidden (view full) ---

392
393 if (error)
394 return (error);
395
396 error = SYSCTL_IN(req, addrs, sizeof(addrs));
397 if (error)
398 return (error);
399
350 &inp, &net, 1, vrf_id);
351 if (stcb != NULL && inp && (inp->sctp_socket != NULL)) {
352 if (cmd != PRC_MSGSIZE) {
353 sctp_notify(inp, ip, sh,
354 (struct sockaddr *)&to, stcb,
355 net);
356 } else {
357 /* handle possible ICMP size messages */

--- 34 unchanged lines hidden (view full) ---

392
393 if (error)
394 return (error);
395
396 error = SYSCTL_IN(req, addrs, sizeof(addrs));
397 if (error)
398 return (error);
399
400 stcb = sctp_findassociation_addr_sa(sintosa(&addrs[0]),
401 sintosa(&addrs[1]),
400 stcb = sctp_findassociation_addr_sa(sintosa(&addrs[1]),
401 sintosa(&addrs[0]),
402 &inp, &net, 1, vrf_id);
403 if (stcb == NULL || inp == NULL || inp->sctp_socket == NULL) {
404 if ((inp != NULL) && (stcb == NULL)) {
405 /* reduce ref-count */
406 SCTP_INP_WLOCK(inp);
407 SCTP_INP_DECR_REF(inp);
408 goto cred_can_cont;
409 }

--- 6091 unchanged lines hidden ---
402 &inp, &net, 1, vrf_id);
403 if (stcb == NULL || inp == NULL || inp->sctp_socket == NULL) {
404 if ((inp != NULL) && (stcb == NULL)) {
405 /* reduce ref-count */
406 SCTP_INP_WLOCK(inp);
407 SCTP_INP_DECR_REF(inp);
408 goto cred_can_cont;
409 }

--- 6091 unchanged lines hidden ---