Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_output.c
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
#include <netinet/in_rss.h> | #include <netinet/in_rss.h> | ||||
#include <netinet/in_var.h> | #include <netinet/in_var.h> | ||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
#include <netinet/ip_options.h> | #include <netinet/ip_options.h> | ||||
#include <netinet/udp.h> | #include <netinet/udp.h> | ||||
#include <netinet/udp_var.h> | #include <netinet/udp_var.h> | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
#include <netinet/sctp.h> | #include <netinet/sctp.h> | ||||
#include <netinet/sctp_crc32.h> | #include <netinet/sctp_crc32.h> | ||||
#endif | #endif | ||||
#include <netipsec/ipsec_support.h> | #include <netipsec/ipsec_support.h> | ||||
#include <machine/in_cksum.h> | #include <machine/in_cksum.h> | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (in_localip(ip->ip_dst)) { | ||||
m->m_pkthdr.rcvif = V_loif; | m->m_pkthdr.rcvif = V_loif; | ||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | ||||
m->m_pkthdr.csum_flags |= | m->m_pkthdr.csum_flags |= | ||||
CSUM_DATA_VALID | CSUM_PSEUDO_HDR; | CSUM_DATA_VALID | CSUM_PSEUDO_HDR; | ||||
m->m_pkthdr.csum_data = 0xffff; | m->m_pkthdr.csum_data = 0xffff; | ||||
} | } | ||||
m->m_pkthdr.csum_flags |= | m->m_pkthdr.csum_flags |= | ||||
CSUM_IP_CHECKED | CSUM_IP_VALID; | CSUM_IP_CHECKED | CSUM_IP_VALID; | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP) | if (m->m_pkthdr.csum_flags & CSUM_SCTP) | ||||
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | ||||
#endif | #endif | ||||
*error = netisr_queue(NETISR_IP, m); | *error = netisr_queue(NETISR_IP, m); | ||||
return 1; /* Finished */ | return 1; /* Finished */ | ||||
} | } | ||||
bzero(dst, sizeof(*dst)); | bzero(dst, sizeof(*dst)); | ||||
Show All 14 Lines | #endif | ||||
if (m->m_flags & M_FASTFWD_OURS) { | if (m->m_flags & M_FASTFWD_OURS) { | ||||
if (m->m_pkthdr.rcvif == NULL) | if (m->m_pkthdr.rcvif == NULL) | ||||
m->m_pkthdr.rcvif = V_loif; | m->m_pkthdr.rcvif = V_loif; | ||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | ||||
m->m_pkthdr.csum_flags |= | m->m_pkthdr.csum_flags |= | ||||
CSUM_DATA_VALID | CSUM_PSEUDO_HDR; | CSUM_DATA_VALID | CSUM_PSEUDO_HDR; | ||||
m->m_pkthdr.csum_data = 0xffff; | m->m_pkthdr.csum_data = 0xffff; | ||||
} | } | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP) | if (m->m_pkthdr.csum_flags & CSUM_SCTP) | ||||
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | ||||
#endif | #endif | ||||
m->m_pkthdr.csum_flags |= | m->m_pkthdr.csum_flags |= | ||||
CSUM_IP_CHECKED | CSUM_IP_VALID; | CSUM_IP_CHECKED | CSUM_IP_VALID; | ||||
*error = netisr_queue(NETISR_IP, m); | *error = netisr_queue(NETISR_IP, m); | ||||
return 1; /* Finished */ | return 1; /* Finished */ | ||||
▲ Show 20 Lines • Show All 538 Lines • ▼ Show 20 Lines | #endif /* IPSEC */ | ||||
} else if ((ifp->if_capenable & IFCAP_NOMAP) == 0) { | } else if ((ifp->if_capenable & IFCAP_NOMAP) == 0) { | ||||
m = mb_unmapped_to_ext(m); | m = mb_unmapped_to_ext(m); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
IPSTAT_INC(ips_odropped); | IPSTAT_INC(ips_odropped); | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
} | } | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { | if (m->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { | ||||
m = mb_unmapped_to_ext(m); | m = mb_unmapped_to_ext(m); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
IPSTAT_INC(ips_odropped); | IPSTAT_INC(ips_odropped); | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); | sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); | ||||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { | ||||
if (m0 == NULL) { | if (m0 == NULL) { | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
IPSTAT_INC(ips_odropped); | IPSTAT_INC(ips_odropped); | ||||
goto done; | goto done; | ||||
} | } | ||||
in_delayed_cksum(m0); | in_delayed_cksum(m0); | ||||
m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; | ||||
} | } | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { | if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { | ||||
m0 = mb_unmapped_to_ext(m0); | m0 = mb_unmapped_to_ext(m0); | ||||
if (m0 == NULL) { | if (m0 == NULL) { | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
IPSTAT_INC(ips_odropped); | IPSTAT_INC(ips_odropped); | ||||
goto done; | goto done; | ||||
} | } | ||||
sctp_delayed_cksum(m0, hlen); | sctp_delayed_cksum(m0, hlen); | ||||
▲ Show 20 Lines • Show All 674 Lines • Show Last 20 Lines |