|
version 1.46, 2008/05/22 01:06:40
|
version 1.47, 2008/08/22 17:11:39
|
|
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); |
| } |
} |
| } |
} |