Deleted Added
full compact
sctp_pcb.c (185694) sctp_pcb.c (185895)
1/*-
2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

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

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

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

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 185694 2008-12-06 13:19:54Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 185895 2008-12-10 23:12:39Z zec $");
35
36#include <netinet/sctp_os.h>
37#include <sys/proc.h>
38#include <netinet/sctp_var.h>
39#include <netinet/sctp_sysctl.h>
40#include <netinet/sctp_pcb.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp.h>

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

54/* "scopeless" replacement IN6_ARE_ADDR_EQUAL */
55#ifdef INET6
56int
57SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
58{
59 struct sockaddr_in6 tmp_a, tmp_b;
60
61 memcpy(&tmp_a, a, sizeof(struct sockaddr_in6));
35
36#include <netinet/sctp_os.h>
37#include <sys/proc.h>
38#include <netinet/sctp_var.h>
39#include <netinet/sctp_sysctl.h>
40#include <netinet/sctp_pcb.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp.h>

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

54/* "scopeless" replacement IN6_ARE_ADDR_EQUAL */
55#ifdef INET6
56int
57SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
58{
59 struct sockaddr_in6 tmp_a, tmp_b;
60
61 memcpy(&tmp_a, a, sizeof(struct sockaddr_in6));
62 if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone))) != 0) {
62 if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) {
63 return 0;
64 }
65 memcpy(&tmp_b, b, sizeof(struct sockaddr_in6));
63 return 0;
64 }
65 memcpy(&tmp_b, b, sizeof(struct sockaddr_in6));
66 if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone))) != 0) {
66 if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) {
67 return 0;
68 }
69 return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr));
70}
71
72#endif
73
74void

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

2003 bzero(from6, sizeof(*from6));
2004 from6->sin6_family = AF_INET6;
2005 from6->sin6_len = sizeof(struct sockaddr_in6);
2006 from6->sin6_addr = ip6->ip6_src;
2007 from6->sin6_port = sh->src_port;
2008 /* Get the scopes in properly to the sin6 addr's */
2009 /* we probably don't need these operations */
2010 (void)sa6_recoverscope(from6);
67 return 0;
68 }
69 return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr));
70}
71
72#endif
73
74void

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

2003 bzero(from6, sizeof(*from6));
2004 from6->sin6_family = AF_INET6;
2005 from6->sin6_len = sizeof(struct sockaddr_in6);
2006 from6->sin6_addr = ip6->ip6_src;
2007 from6->sin6_port = sh->src_port;
2008 /* Get the scopes in properly to the sin6 addr's */
2009 /* we probably don't need these operations */
2010 (void)sa6_recoverscope(from6);
2011 sa6_embedscope(from6, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)));
2011 sa6_embedscope(from6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone));
2012 break;
2013 }
2014#endif
2015 default:
2016 /* Currently not supported. */
2017 return (NULL);
2018 }
2019

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

2044 bzero(to6, sizeof(*to6));
2045 to6->sin6_family = AF_INET6;
2046 to6->sin6_len = sizeof(struct sockaddr_in6);
2047 to6->sin6_addr = ip6->ip6_dst;
2048 to6->sin6_port = sh->dest_port;
2049 /* Get the scopes in properly to the sin6 addr's */
2050 /* we probably don't need these operations */
2051 (void)sa6_recoverscope(to6);
2012 break;
2013 }
2014#endif
2015 default:
2016 /* Currently not supported. */
2017 return (NULL);
2018 }
2019

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

2044 bzero(to6, sizeof(*to6));
2045 to6->sin6_family = AF_INET6;
2046 to6->sin6_len = sizeof(struct sockaddr_in6);
2047 to6->sin6_addr = ip6->ip6_dst;
2048 to6->sin6_port = sh->dest_port;
2049 /* Get the scopes in properly to the sin6 addr's */
2050 /* we probably don't need these operations */
2051 (void)sa6_recoverscope(to6);
2052 sa6_embedscope(to6, MODULE_GLOBAL(MOD_INET6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)));
2052 sa6_embedscope(to6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone));
2053 break;
2054 }
2055#endif
2056 default:
2057 /* TSNH */
2058 break;
2059 }
2060 if (sh->v_tag) {

--- 4600 unchanged lines hidden ---
2053 break;
2054 }
2055#endif
2056 default:
2057 /* TSNH */
2058 break;
2059 }
2060 if (sh->v_tag) {

--- 4600 unchanged lines hidden ---