Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/raw_ip6.c
Show First 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | else | ||||
ip6_get_prevhdr(m, *offp)); | ip6_get_prevhdr(m, *offp)); | ||||
IP6STAT_DEC(ip6s_delivered); | IP6STAT_DEC(ip6s_delivered); | ||||
} else | } else | ||||
m_freem(m); | m_freem(m); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
void | void | ||||
rip6_ctlinput(int cmd, struct sockaddr *sa, void *d) | rip6_ctlinput(int cmd, struct sockaddr_in6 *sin6, struct ip6ctlparam *ip6cp) | ||||
{ | { | ||||
struct ip6ctlparam *ip6cp = NULL; | const struct sockaddr_in6 *sa6_src; | ||||
const struct sockaddr_in6 *sa6_src = NULL; | |||||
void *cmdarg; | void *cmdarg; | ||||
struct inpcb *(*notify)(struct inpcb *, int) = in6_rtchange; | struct inpcb *(*notify)(struct inpcb *, int) = in6_rtchange; | ||||
if (sa->sa_family != AF_INET6 || | |||||
sa->sa_len != sizeof(struct sockaddr_in6)) | |||||
return; | |||||
if ((unsigned)cmd >= PRC_NCMDS) | if ((unsigned)cmd >= PRC_NCMDS) | ||||
return; | return; | ||||
if (PRC_IS_REDIRECT(cmd)) | if (PRC_IS_REDIRECT(cmd)) | ||||
notify = in6_rtchange, d = NULL; | notify = in6_rtchange, ip6cp = NULL; | ||||
else if (cmd == PRC_HOSTDEAD) | else if (cmd == PRC_HOSTDEAD) | ||||
d = NULL; | ip6cp = NULL; | ||||
else if (inet6ctlerrmap[cmd] == 0) | else if (inet6ctlerrmap[cmd] == 0) | ||||
return; | return; | ||||
/* | /* | ||||
* If the parameter is from icmp6, decode it. | * If the parameter is from icmp6, decode it. | ||||
*/ | */ | ||||
if (d != NULL) { | if (ip6cp != NULL) { | ||||
ip6cp = (struct ip6ctlparam *)d; | |||||
cmdarg = ip6cp->ip6c_cmdarg; | cmdarg = ip6cp->ip6c_cmdarg; | ||||
sa6_src = ip6cp->ip6c_src; | sa6_src = ip6cp->ip6c_src; | ||||
} else { | } else { | ||||
cmdarg = NULL; | cmdarg = NULL; | ||||
sa6_src = &sa6_any; | sa6_src = &sa6_any; | ||||
} | } | ||||
(void) in6_pcbnotify(&V_ripcbinfo, sa, 0, | in6_pcbnotify(&V_ripcbinfo, sin6, 0, sa6_src, 0, cmd, cmdarg, notify); | ||||
(const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify); | |||||
} | } | ||||
/* | /* | ||||
* Generate IPv6 header and pass packet to ip6_output. Tack on options user | * Generate IPv6 header and pass packet to ip6_output. Tack on options user | ||||
* may have setup with control call. | * may have setup with control call. | ||||
*/ | */ | ||||
static int | static int | ||||
rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, | rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, | ||||
▲ Show 20 Lines • Show All 522 Lines • Show Last 20 Lines |