version 1.74, 2016/08/01 03:15:31 |
version 1.82, 2017/02/22 07:46:00 |
Line 106 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 106 __KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#ifdef _KERNEL_OPT |
#ifdef _KERNEL_OPT |
#include "opt_inet.h" |
#include "opt_inet.h" |
|
#include "opt_net_mpsafe.h" |
#endif |
#endif |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
Line 113 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 114 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/mbuf.h> |
#include <sys/mbuf.h> |
#include <sys/socket.h> |
#include <sys/socket.h> |
#include <sys/socketvar.h> |
#include <sys/socketvar.h> |
#include <sys/protosw.h> |
|
#include <sys/syslog.h> |
#include <sys/syslog.h> |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
#include <sys/kernel.h> |
#include <sys/kernel.h> |
Line 229 mld_timeo(void *arg) |
|
Line 229 mld_timeo(void *arg) |
|
{ |
{ |
struct in6_multi *in6m = arg; |
struct in6_multi *in6m = arg; |
|
|
|
/* XXX NOMPSAFE still need softnet_lock */ |
mutex_enter(softnet_lock); |
mutex_enter(softnet_lock); |
KERNEL_LOCK(1, NULL); |
KERNEL_LOCK(1, NULL); |
|
|
Line 344 mld_input(struct mbuf *m, int off) |
|
Line 345 mld_input(struct mbuf *m, int off) |
|
int s; |
int s; |
|
|
ifp = m_get_rcvif(m, &s); |
ifp = m_get_rcvif(m, &s); |
|
if (__predict_false(ifp == NULL)) |
|
goto out; |
IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh)); |
IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh)); |
if (mldh == NULL) { |
if (mldh == NULL) { |
ICMP6_STATINC(ICMP6_STAT_TOOSHORT); |
ICMP6_STATINC(ICMP6_STAT_TOOSHORT); |
Line 373 mld_input(struct mbuf *m, int off) |
|
Line 376 mld_input(struct mbuf *m, int off) |
|
* though RFC3590 says "SHOULD log" if the source of a query |
* though RFC3590 says "SHOULD log" if the source of a query |
* is the unspecified address. |
* is the unspecified address. |
*/ |
*/ |
|
char ip6bufs[INET6_ADDRSTRLEN]; |
|
char ip6bufm[INET6_ADDRSTRLEN]; |
log(LOG_INFO, |
log(LOG_INFO, |
"mld_input: src %s is not link-local (grp=%s)\n", |
"mld_input: src %s is not link-local (grp=%s)\n", |
ip6_sprintf(&ip6->ip6_src), ip6_sprintf(&mldh->mld_addr)); |
IN6_PRINT(ip6bufs,&ip6->ip6_src), |
|
IN6_PRINT(ip6bufm, &mldh->mld_addr)); |
#endif |
#endif |
goto out; |
goto out; |
} |
} |
Line 487 mld_input(struct mbuf *m, int off) |
|
Line 493 mld_input(struct mbuf *m, int off) |
|
* If we belong to the group being reported, stop |
* If we belong to the group being reported, stop |
* our timer for that group. |
* our timer for that group. |
*/ |
*/ |
IN6_LOOKUP_MULTI(mld_addr, ifp, in6m); |
in6m = in6_lookup_multi(&mld_addr, ifp); |
if (in6m) { |
if (in6m) { |
mld_stoptimer(in6m); /* transit to idle state */ |
mld_stoptimer(in6m); /* transit to idle state */ |
in6m->in6m_state = MLD_OTHERLISTENER; /* clear flag */ |
in6m->in6m_state = MLD_OTHERLISTENER; /* clear flag */ |
Line 659 in6_addmulti(struct in6_addr *maddr6, st |
|
Line 665 in6_addmulti(struct in6_addr *maddr6, st |
|
/* |
/* |
* See if address already in list. |
* See if address already in list. |
*/ |
*/ |
IN6_LOOKUP_MULTI(*maddr6, ifp, in6m); |
in6m = in6_lookup_multi(maddr6, ifp); |
if (in6m != NULL) { |
if (in6m != NULL) { |
/* |
/* |
* Found it; just increment the refrence count. |
* Found it; just increment the refrence count. |
Line 789 in6_delmulti(struct in6_multi *in6m) |
|
Line 795 in6_delmulti(struct in6_multi *in6m) |
|
|
|
/* Tell mld_timeo we're halting the timer */ |
/* Tell mld_timeo we're halting the timer */ |
in6m->in6m_timer = IN6M_TIMER_UNDEF; |
in6m->in6m_timer = IN6M_TIMER_UNDEF; |
callout_halt(&in6m->in6m_timer_ch, softnet_lock); |
if (mutex_owned(softnet_lock)) |
|
callout_halt(&in6m->in6m_timer_ch, softnet_lock); |
|
else |
|
callout_halt(&in6m->in6m_timer_ch, NULL); |
callout_destroy(&in6m->in6m_timer_ch); |
callout_destroy(&in6m->in6m_timer_ch); |
|
|
free(in6m, M_IPMADDR); |
free(in6m, M_IPMADDR); |
|
|
return error; |
return error; |
} |
} |
|
|
SYSCTL_SETUP(sysctl_in6_mklude_setup, "sysctl net.inet6.multicast_kludge subtree setup") |
void |
|
in6_sysctl_multicast_setup(struct sysctllog **clog) |
{ |
{ |
|
|
sysctl_createv(clog, 0, NULL, NULL, |
sysctl_createv(clog, 0, NULL, NULL, |