Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/ip6_output.c
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet/in_pcb.h> | #include <netinet/in_pcb.h> | ||||
#include <netinet/tcp_var.h> | #include <netinet/tcp_var.h> | ||||
#include <netinet6/nd6.h> | #include <netinet6/nd6.h> | ||||
#include <netinet6/in6_rss.h> | #include <netinet6/in6_rss.h> | ||||
#include <netipsec/ipsec_support.h> | #include <netipsec/ipsec_support.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 <netinet6/ip6protosw.h> | #include <netinet6/ip6protosw.h> | ||||
#include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||
extern int in6_mcast_loop; | extern int in6_mcast_loop; | ||||
▲ Show 20 Lines • Show All 788 Lines • ▼ Show 20 Lines | if (in6_localip(&ip6->ip6_dst)) { | ||||
m->m_flags |= M_FASTFWD_OURS; | 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_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | ||||
m->m_pkthdr.csum_flags |= | m->m_pkthdr.csum_flags |= | ||||
CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; | CSUM_DATA_VALID_IPV6 | 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_IPV6) | if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) | ||||
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | ||||
#endif | #endif | ||||
error = netisr_queue(NETISR_IPV6, m); | error = netisr_queue(NETISR_IPV6, m); | ||||
goto done; | goto done; | ||||
} else { | } else { | ||||
RO_INVALIDATE_CACHE(ro); | RO_INVALIDATE_CACHE(ro); | ||||
needfiblookup = 1; /* Redo the routing table lookup. */ | needfiblookup = 1; /* Redo the routing table lookup. */ | ||||
Show All 13 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_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | ||||
m->m_pkthdr.csum_flags |= | m->m_pkthdr.csum_flags |= | ||||
CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; | CSUM_DATA_VALID_IPV6 | 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_IPV6) | if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) | ||||
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; | ||||
#endif | #endif | ||||
error = netisr_queue(NETISR_IPV6, m); | error = netisr_queue(NETISR_IPV6, m); | ||||
goto done; | goto done; | ||||
} | } | ||||
/* Or forward to some other address? */ | /* Or forward to some other address? */ | ||||
if ((m->m_flags & M_IP6_NEXTHOP) && | if ((m->m_flags & M_IP6_NEXTHOP) && | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | passout: | ||||
} 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) { | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
IP6STAT_INC(ip6s_odropped); | IP6STAT_INC(ip6s_odropped); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
} | } | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (sw_csum & CSUM_SCTP_IPV6) { | if (sw_csum & CSUM_SCTP_IPV6) { | ||||
sw_csum &= ~CSUM_SCTP_IPV6; | sw_csum &= ~CSUM_SCTP_IPV6; | ||||
m = mb_unmapped_to_ext(m); | m = mb_unmapped_to_ext(m); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
IP6STAT_INC(ip6s_odropped); | IP6STAT_INC(ip6s_odropped); | ||||
goto bad; | goto bad; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { | ||||
if (m == NULL) { | if (m == NULL) { | ||||
in6_ifstat_inc(ifp, ifs6_out_fragfail); | in6_ifstat_inc(ifp, ifs6_out_fragfail); | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
in6_delayed_cksum(m, plen, hlen); | in6_delayed_cksum(m, plen, hlen); | ||||
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; | ||||
} | } | ||||
#ifdef SCTP | #if defined(SCTP) || defined(SCTP_SUPPORT) | ||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { | ||||
m = mb_unmapped_to_ext(m); | m = mb_unmapped_to_ext(m); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
in6_ifstat_inc(ifp, ifs6_out_fragfail); | in6_ifstat_inc(ifp, ifs6_out_fragfail); | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
sctp_delayed_cksum(m, hlen); | sctp_delayed_cksum(m, hlen); | ||||
▲ Show 20 Lines • Show All 2,114 Lines • Show Last 20 Lines |