Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/udp6_usrreq.c
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#include "opt_ipfw.h" | #include "opt_ipfw.h" | ||||
#include "opt_ipsec.h" | #include "opt_ipsec.h" | ||||
#include "opt_rss.h" | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/jail.h> | #include <sys/jail.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/priv.h> | #include <sys/priv.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
Show All 21 Lines | |||||
#include <netinet/ip_icmp.h> | #include <netinet/ip_icmp.h> | ||||
#include <netinet/ip6.h> | #include <netinet/ip6.h> | ||||
#include <netinet/icmp_var.h> | #include <netinet/icmp_var.h> | ||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
#include <netinet/udp.h> | #include <netinet/udp.h> | ||||
#include <netinet/udp_var.h> | #include <netinet/udp_var.h> | ||||
#include <netinet/udplite.h> | #include <netinet/udplite.h> | ||||
#include <netinet/in_rss.h> | |||||
#include <netinet6/ip6protosw.h> | #include <netinet6/ip6protosw.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet6/in6_pcb.h> | #include <netinet6/in6_pcb.h> | ||||
#include <netinet6/udp6_var.h> | #include <netinet6/udp6_var.h> | ||||
#include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||
#ifdef IPSEC | #ifdef IPSEC | ||||
▲ Show 20 Lines • Show All 723 Lines • ▼ Show 20 Lines | if (cscov_partial) { | ||||
sizeof(struct ip6_hdr), cscov)) == 0) | sizeof(struct ip6_hdr), cscov)) == 0) | ||||
udp6->uh_sum = 0xffff; | udp6->uh_sum = 0xffff; | ||||
} else { | } else { | ||||
udp6->uh_sum = in6_cksum_pseudo(ip6, plen, nxt, 0); | udp6->uh_sum = in6_cksum_pseudo(ip6, plen, nxt, 0); | ||||
m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; | m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; | ||||
m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); | m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); | ||||
} | } | ||||
/* | |||||
* XXX for now assume UDP is 2-tuple. | |||||
* Later on this may become configurable as 4-tuple; | |||||
* we should support that. | |||||
* | |||||
* XXX .. and we should likely cache this in the inpcb. | |||||
*/ | |||||
#ifdef RSS | |||||
m->m_pkthdr.flowid = rss_hash_ip6_2tuple(*faddr, *laddr); | |||||
m->m_flags |= M_FLOWID; | |||||
M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV6); | |||||
#endif | |||||
flags = 0; | flags = 0; | ||||
/* | |||||
* Don't override with the inp cached flowid. | |||||
* | |||||
* Until the whole UDP path is vetted, it may actually | |||||
* be incorrect. | |||||
*/ | |||||
flags |= IP_NODEFAULTFLOWID; | |||||
UDP_PROBE(send, NULL, inp, ip6, inp, udp6); | UDP_PROBE(send, NULL, inp, ip6, inp, udp6); | ||||
UDPSTAT_INC(udps_opackets); | UDPSTAT_INC(udps_opackets); | ||||
error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, | error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, | ||||
NULL, inp); | NULL, inp); | ||||
break; | break; | ||||
case AF_INET: | case AF_INET: | ||||
error = EAFNOSUPPORT; | error = EAFNOSUPPORT; | ||||
▲ Show 20 Lines • Show All 384 Lines • Show Last 20 Lines |