version 1.44.2.2, 2008/06/04 02:05:48 |
version 1.47.2.2, 2009/04/28 07:37:24 |
|
|
hbh_buf[3] = 0; |
hbh_buf[3] = 0; |
hbh_buf[4] = IP6OPT_RTALERT; |
hbh_buf[4] = IP6OPT_RTALERT; |
hbh_buf[5] = IP6OPT_RTALERT_LEN - 2; |
hbh_buf[5] = IP6OPT_RTALERT_LEN - 2; |
bcopy((void *)&rtalert_code, &hbh_buf[6], sizeof(u_int16_t)); |
memcpy(&hbh_buf[6], (void *)&rtalert_code, sizeof(u_int16_t)); |
|
|
ip6_opts.ip6po_hbh = hbh; |
ip6_opts.ip6po_hbh = hbh; |
/* We will specify the hoplimit by a multicast option. */ |
/* We will specify the hoplimit by a multicast option. */ |
Line 262 mld_timerresid(struct in6_multi *in6m) |
|
Line 262 mld_timerresid(struct in6_multi *in6m) |
|
} |
} |
|
|
/* return the remaining time in milliseconds */ |
/* return the remaining time in milliseconds */ |
return (((u_long)(diff.tv_sec * 1000000 + diff.tv_usec)) / 1000); |
return diff.tv_sec * 1000 + diff.tv_usec / 1000; |
} |
} |
|
|
static void |
static void |
Line 330 mld_input(struct mbuf *m, int off) |
|
Line 330 mld_input(struct mbuf *m, int off) |
|
struct in6_multi *in6m = NULL; |
struct in6_multi *in6m = NULL; |
struct in6_addr mld_addr, all_in6; |
struct in6_addr mld_addr, all_in6; |
struct in6_ifaddr *ia; |
struct in6_ifaddr *ia; |
int timer = 0; /* timer value in the MLD query header */ |
u_long timer = 0; /* timer value in the MLD query header */ |
|
|
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) { |
Line 441 mld_input(struct mbuf *m, int off) |
|
Line 441 mld_input(struct mbuf *m, int off) |
|
mld_sendpkt(in6m, MLD_LISTENER_REPORT, NULL); |
mld_sendpkt(in6m, MLD_LISTENER_REPORT, NULL); |
in6m->in6m_state = MLD_IREPORTEDLAST; |
in6m->in6m_state = MLD_IREPORTEDLAST; |
} else if (in6m->in6m_timer == IN6M_TIMER_UNDEF || |
} else if (in6m->in6m_timer == IN6M_TIMER_UNDEF || |
mld_timerresid(in6m) > (u_long)timer) { |
mld_timerresid(in6m) > timer) { |
in6m->in6m_timer = arc4random() % |
in6m->in6m_timer = |
(int)(((long)timer * hz) / 1000); |
1 + (arc4random() % timer) * hz / 1000; |
mld_starttimer(in6m); |
mld_starttimer(in6m); |
} |
} |
} |
} |
Line 665 in6_addmulti(struct in6_addr *maddr6, st |
|
Line 665 in6_addmulti(struct in6_addr *maddr6, st |
|
* filter appropriately for the new address. |
* filter appropriately for the new address. |
*/ |
*/ |
sockaddr_in6_init(&ifr.ifr_addr, maddr6, 0, 0, 0); |
sockaddr_in6_init(&ifr.ifr_addr, maddr6, 0, 0, 0); |
if (ifp->if_ioctl == NULL) |
*errorp = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, &ifr); |
*errorp = ENXIO; /* XXX: appropriate? */ |
|
else |
|
*errorp = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, &ifr); |
|
if (*errorp) { |
if (*errorp) { |
LIST_REMOVE(in6m, in6m_entry); |
LIST_REMOVE(in6m, in6m_entry); |
free(in6m, M_IPMADDR); |
free(in6m, M_IPMADDR); |