Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix interval calculation #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions usr.sbin/mcast-proxy/mcast-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
* Group membership interval is composed by the following formula:
* (Robustness * Query_Interval) + Query_Response_Interval.
*/
#define IGMP_GROUP_MEMBERSHIP_INTERVAL(r, q) \
(((r) * (q)) + IGMP_RESPONSE_INTERVAL)
#define IGMP_GROUP_MEMBERSHIP_INTERVAL ((IGMP_ROBUSTNESS_DEFVALUE * \
IGMP_QUERY_INTERVAL) + IGMP_RESPONSE_INTERVAL)

/* Signalize invalid virtual/multicast interface index. */
#define INVALID_VINDEX ((uint16_t)-1)
Expand Down
6 changes: 1 addition & 5 deletions usr.sbin/mcast-proxy/mrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,11 @@ mrt_delorigin(struct multicast_route *mr, struct intf_data *id,
void
mrt_timeradd(struct event *ev)
{
unsigned long total = IGMP_GROUP_MEMBERSHIP_INTERVAL(
IGMP_ROBUSTNESS_DEFVALUE, IGMP_RESPONSE_INTERVAL);
struct timeval tv;
struct timeval tv = { IGMP_GROUP_MEMBERSHIP_INTERVAL, 0 };

if (evtimer_pending(ev, &tv))
evtimer_del(ev);

tv.tv_sec = total;
tv.tv_usec = 0;
evtimer_add(ev, &tv);
}

Expand Down