sctp6_usrreq.c (163954) | sctp6_usrreq.c (163996) |
---|---|
1/*- 2 * Copyright (c) 2001-2006, 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. --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 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/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2006, 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. --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 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/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 163954 2006-11-03 17:21:53Z rrs $"); | 32__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 163996 2006-11-05 13:25:18Z rrs $"); |
33#include "opt_inet.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36#include "opt_ipsec.h" 37#include "opt_sctp.h" 38 39#include <sys/param.h> 40#include <sys/kernel.h> --- 34 unchanged lines hidden (view full) --- 75#include <netinet6/in6_pcb.h> 76#include <netinet/icmp6.h> 77#include <netinet6/sctp6_var.h> 78#include <netinet6/ip6protosw.h> 79#include <netinet6/nd6.h> 80 81#ifdef IPSEC 82#include <netinet6/ipsec.h> | 33#include "opt_inet.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36#include "opt_ipsec.h" 37#include "opt_sctp.h" 38 39#include <sys/param.h> 40#include <sys/kernel.h> --- 34 unchanged lines hidden (view full) --- 75#include <netinet6/in6_pcb.h> 76#include <netinet/icmp6.h> 77#include <netinet6/sctp6_var.h> 78#include <netinet6/ip6protosw.h> 79#include <netinet6/nd6.h> 80 81#ifdef IPSEC 82#include <netinet6/ipsec.h> |
83#include <netinet6/ipsec6.h> |
|
83#endif /* IPSEC */ 84 85#if defined(NFAITH) && NFAITH > 0 86#include <net/if_faith.h> 87#endif 88 89 90 --- 97 unchanged lines hidden (view full) --- 188 if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst)) 189 goto sctp_skip_csum; 190 } 191 sh->checksum = 0; /* prepare for calc */ 192 calc_check = sctp_calculate_sum(m, &mlen, iphlen); 193 if (calc_check != check) { 194#ifdef SCTP_DEBUG 195 if (sctp_debug_on & SCTP_DEBUG_INPUT1) { | 84#endif /* IPSEC */ 85 86#if defined(NFAITH) && NFAITH > 0 87#include <net/if_faith.h> 88#endif 89 90 91 --- 97 unchanged lines hidden (view full) --- 189 if (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst)) 190 goto sctp_skip_csum; 191 } 192 sh->checksum = 0; /* prepare for calc */ 193 calc_check = sctp_calculate_sum(m, &mlen, iphlen); 194 if (calc_check != check) { 195#ifdef SCTP_DEBUG 196 if (sctp_debug_on & SCTP_DEBUG_INPUT1) { |
196 printf("Bad CSUM on SCTP packet calc_check:%x check:%x m:%x mlen:%d iphlen:%d\n", 197 calc_check, check, (u_int)m, | 197 printf("Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", 198 calc_check, check, m, |
198 mlen, iphlen); 199 } 200#endif 201 stcb = sctp_findassociation_addr(m, iphlen, offset - sizeof(*ch), 202 sh, ch, &in6p, &net); 203 /* in6p's ref-count increased && stcb locked */ 204 if ((in6p) && (stcb)) { 205 sctp_send_packet_dropped(stcb, net, m, iphlen, 1); --- 38 unchanged lines hidden (view full) --- 244 } else if (stcb == NULL) { 245 refcount_up = 1; 246 } 247 in6p_ip = (struct inpcb *)in6p; 248#ifdef IPSEC 249 /* 250 * Check AH/ESP integrity. 251 */ | 199 mlen, iphlen); 200 } 201#endif 202 stcb = sctp_findassociation_addr(m, iphlen, offset - sizeof(*ch), 203 sh, ch, &in6p, &net); 204 /* in6p's ref-count increased && stcb locked */ 205 if ((in6p) && (stcb)) { 206 sctp_send_packet_dropped(stcb, net, m, iphlen, 1); --- 38 unchanged lines hidden (view full) --- 245 } else if (stcb == NULL) { 246 refcount_up = 1; 247 } 248 in6p_ip = (struct inpcb *)in6p; 249#ifdef IPSEC 250 /* 251 * Check AH/ESP integrity. 252 */ |
252 if (in6p->sctp_socket && (ipsec6_in_reject_so(m, in6p->sctp_socket)) { | 253 if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { |
253/* XXX */ 254 ipsec6stat.in_polvio++; 255 goto bad; | 254/* XXX */ 255 ipsec6stat.in_polvio++; 256 goto bad; |
256 } | 257 } |
257#endif /* IPSEC */ 258 259 260 /* 261 * CONTROL chunk processing 262 */ 263 length = ntohs(ip6->ip6_plen) + iphlen; 264 offset -= sizeof(*ch); --- 1107 unchanged lines hidden --- | 258#endif /* IPSEC */ 259 260 261 /* 262 * CONTROL chunk processing 263 */ 264 length = ntohs(ip6->ip6_plen) + iphlen; 265 offset -= sizeof(*ch); --- 1107 unchanged lines hidden --- |