Deleted Added
full compact
sctp_output.c (236087) sctp_output.c (236332)
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_output.c 236087 2012-05-26 09:16:33Z tuexen $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 236332 2012-05-30 20:56:07Z tuexen $");
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_header.h>
41#include <netinet/sctp_pcb.h>
42#include <netinet/sctputil.h>

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

4473#endif
4474 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) {
4475 udp->uh_sum = 0xffff;
4476 }
4477 } else {
4478#if defined(SCTP_WITH_NO_CSUM)
4479 SCTP_STAT_INCR(sctps_sendnocrc);
4480#else
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_header.h>
41#include <netinet/sctp_pcb.h>
42#include <netinet/sctputil.h>

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

4473#endif
4474 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) {
4475 udp->uh_sum = 0xffff;
4476 }
4477 } else {
4478#if defined(SCTP_WITH_NO_CSUM)
4479 SCTP_STAT_INCR(sctps_sendnocrc);
4480#else
4481 m->m_pkthdr.csum_flags = CSUM_SCTP;
4481 m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
4482 m->m_pkthdr.csum_data = 0;
4483 SCTP_STAT_INCR(sctps_sendhwcrc);
4484#endif
4485 }
4486 /* send it out. table id is taken from stcb */
4487#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
4488 if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) {
4489 so = SCTP_INP_SO(inp);

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

11067#endif
11068 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), mlen - sizeof(struct ip6_hdr))) == 0) {
11069 udp->uh_sum = 0xffff;
11070 }
11071 } else {
11072#if defined(SCTP_WITH_NO_CSUM)
11073 SCTP_STAT_INCR(sctps_sendnocrc);
11074#else
4482 m->m_pkthdr.csum_data = 0;
4483 SCTP_STAT_INCR(sctps_sendhwcrc);
4484#endif
4485 }
4486 /* send it out. table id is taken from stcb */
4487#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
4488 if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) {
4489 so = SCTP_INP_SO(inp);

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

11067#endif
11068 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), mlen - sizeof(struct ip6_hdr))) == 0) {
11069 udp->uh_sum = 0xffff;
11070 }
11071 } else {
11072#if defined(SCTP_WITH_NO_CSUM)
11073 SCTP_STAT_INCR(sctps_sendnocrc);
11074#else
11075 mout->m_pkthdr.csum_flags = CSUM_SCTP;
11075 mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
11076 mout->m_pkthdr.csum_data = 0;
11077 SCTP_STAT_INCR(sctps_sendhwcrc);
11078#endif
11079 }
11080 SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
11081
11082 /* Free the route if we got one back */
11083 if (ro.ro_rt)

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

12174#endif
12175 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) {
12176 udp->uh_sum = 0xffff;
12177 }
12178 } else {
12179#if defined(SCTP_WITH_NO_CSUM)
12180 SCTP_STAT_INCR(sctps_sendnocrc);
12181#else
11076 mout->m_pkthdr.csum_data = 0;
11077 SCTP_STAT_INCR(sctps_sendhwcrc);
11078#endif
11079 }
11080 SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
11081
11082 /* Free the route if we got one back */
11083 if (ro.ro_rt)

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

12174#endif
12175 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) {
12176 udp->uh_sum = 0xffff;
12177 }
12178 } else {
12179#if defined(SCTP_WITH_NO_CSUM)
12180 SCTP_STAT_INCR(sctps_sendnocrc);
12181#else
12182 mout->m_pkthdr.csum_flags = CSUM_SCTP;
12182 mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
12183 mout->m_pkthdr.csum_data = 0;
12184 SCTP_STAT_INCR(sctps_sendhwcrc);
12185#endif
12186 }
12187 SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
12188
12189 /* Free the route if we got one back */
12190 if (ro.ro_rt)

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

12438#endif
12439 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) {
12440 udp->uh_sum = 0xffff;
12441 }
12442 } else {
12443#if defined(SCTP_WITH_NO_CSUM)
12444 SCTP_STAT_INCR(sctps_sendnocrc);
12445#else
12183 mout->m_pkthdr.csum_data = 0;
12184 SCTP_STAT_INCR(sctps_sendhwcrc);
12185#endif
12186 }
12187 SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
12188
12189 /* Free the route if we got one back */
12190 if (ro.ro_rt)

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

12438#endif
12439 if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) {
12440 udp->uh_sum = 0xffff;
12441 }
12442 } else {
12443#if defined(SCTP_WITH_NO_CSUM)
12444 SCTP_STAT_INCR(sctps_sendnocrc);
12445#else
12446 mout->m_pkthdr.csum_flags = CSUM_SCTP;
12446 mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
12447 mout->m_pkthdr.csum_data = 0;
12448 SCTP_STAT_INCR(sctps_sendhwcrc);
12449#endif
12450 }
12451 SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
12452
12453 /* Free the route if we got one back */
12454 if (ro.ro_rt)

--- 1523 unchanged lines hidden ---
12447 mout->m_pkthdr.csum_data = 0;
12448 SCTP_STAT_INCR(sctps_sendhwcrc);
12449#endif
12450 }
12451 SCTP_IP6_OUTPUT(ret, o_pak, &ro, &ifp, NULL, vrf_id);
12452
12453 /* Free the route if we got one back */
12454 if (ro.ro_rt)

--- 1523 unchanged lines hidden ---