Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/raw_ip6.c
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
* @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 | * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_ipsec.h" | #include "opt_ipsec.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#include "opt_route_mpath.h" | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/errno.h> | #include <sys/errno.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/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
Show All 17 Lines | |||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
#include <netinet/in_pcb.h> | #include <netinet/in_pcb.h> | ||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#include <netinet/ip6.h> | #include <netinet/ip6.h> | ||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
#include <netinet6/ip6protosw.h> | #include <netinet6/ip6protosw.h> | ||||
#include <netinet6/ip6_mroute.h> | #include <netinet6/ip6_mroute.h> | ||||
#include <netinet6/in6_fib.h> | |||||
#include <netinet6/in6_pcb.h> | #include <netinet6/in6_pcb.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet6/nd6.h> | #include <netinet6/nd6.h> | ||||
#include <netinet6/raw_ip6.h> | #include <netinet6/raw_ip6.h> | ||||
#include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||
#include <netinet6/send.h> | #include <netinet6/send.h> | ||||
#include <netipsec/ipsec_support.h> | #include <netipsec/ipsec_support.h> | ||||
▲ Show 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | rip6_output(struct mbuf *m, struct socket *so, ...) | ||||
int error = 0; | int error = 0; | ||||
struct ip6_pktopts opt, *optp; | struct ip6_pktopts opt, *optp; | ||||
struct ifnet *oifp = NULL; | struct ifnet *oifp = NULL; | ||||
int type = 0, code = 0; /* for ICMPv6 output statistics only */ | int type = 0, code = 0; /* for ICMPv6 output statistics only */ | ||||
int scope_ambiguous = 0; | int scope_ambiguous = 0; | ||||
int use_defzone = 0; | int use_defzone = 0; | ||||
int hlim = 0; | int hlim = 0; | ||||
struct in6_addr in6a; | struct in6_addr in6a; | ||||
#ifdef ROUTE_MPATH | |||||
uint32_t hash_val, hash_type; | |||||
#endif | |||||
va_list ap; | va_list ap; | ||||
va_start(ap, so); | va_start(ap, so); | ||||
dstsock = va_arg(ap, struct sockaddr_in6 *); | dstsock = va_arg(ap, struct sockaddr_in6 *); | ||||
control = va_arg(ap, struct mbuf *); | control = va_arg(ap, struct mbuf *); | ||||
va_end(ap); | va_end(ap); | ||||
inp = sotoinpcb(so); | inp = sotoinpcb(so); | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | #endif | ||||
M_PREPEND(m, sizeof(*ip6), M_NOWAIT); | M_PREPEND(m, sizeof(*ip6), M_NOWAIT); | ||||
if (m == NULL) { | if (m == NULL) { | ||||
error = ENOBUFS; | error = ENOBUFS; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
ip6 = mtod(m, struct ip6_hdr *); | ip6 = mtod(m, struct ip6_hdr *); | ||||
#ifdef ROUTE_MPATH | |||||
if (V_fib_hash_outbound) { | |||||
hash_val = fib6_calc_software_hash(&inp->in6p_laddr, | |||||
&dstsock->sin6_addr, 0, 0, so->so_proto->pr_protocol, | |||||
&hash_type); | |||||
inp->inp_flowid = hash_val; | |||||
inp->inp_flowtype = hash_type; | |||||
} | |||||
#endif | |||||
/* | /* | ||||
* Source address selection. | * Source address selection. | ||||
*/ | */ | ||||
error = in6_selectsrc_socket(dstsock, optp, inp, so->so_cred, | error = in6_selectsrc_socket(dstsock, optp, inp, so->so_cred, | ||||
scope_ambiguous, &in6a, &hlim); | scope_ambiguous, &in6a, &hlim); | ||||
if (error) | if (error) | ||||
goto bad; | goto bad; | ||||
▲ Show 20 Lines • Show All 442 Lines • Show Last 20 Lines |