"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vif.c" between
mrouted-3.9.7.tar.gz and mrouted-3.9.8.tar.gz

About: mrouted is an implementation of the DVMRP multicast routing protocol.

vif.c  (mrouted-3.9.7):vif.c  (mrouted-3.9.8)
skipping to change at line 638 skipping to change at line 638
* - A query from a new router that just started up and doesn't * - A query from a new router that just started up and doesn't
* know who the querier is. * know who the querier is.
*/ */
if (ntohl(src) < (v->uv_querier ? ntohl(v->uv_querier->al_addr) : ntohl(v ->uv_lcl_addr))) { if (ntohl(src) < (v->uv_querier ? ntohl(v->uv_querier->al_addr) : ntohl(v ->uv_lcl_addr))) {
IF_DEBUG(DEBUG_IGMP) { IF_DEBUG(DEBUG_IGMP) {
logit(LOG_DEBUG, 0, "New querier %s (was %s) on vif %d", inet_fmt (src, s1, sizeof(s1)), logit(LOG_DEBUG, 0, "New querier %s (was %s) on vif %d", inet_fmt (src, s1, sizeof(s1)),
v->uv_querier ? inet_fmt(v->uv_querier->al_addr, s2, sizeof (s2)) : "me", vifi); v->uv_querier ? inet_fmt(v->uv_querier->al_addr, s2, sizeof (s2)) : "me", vifi);
} }
if (!v->uv_querier) { if (!v->uv_querier) {
v->uv_querier = (struct listaddr *)malloc(sizeof(struct listaddr) ); v->uv_querier = malloc(sizeof(struct listaddr));
v->uv_flags &= ~VIFF_QUERIER; v->uv_flags &= ~VIFF_QUERIER;
} }
if (v->uv_querier) { if (v->uv_querier) {
time(&v->uv_querier->al_ctime); time(&v->uv_querier->al_ctime);
v->uv_querier->al_addr = src; v->uv_querier->al_addr = src;
} }
} else { } else {
IF_DEBUG(DEBUG_IGMP) { IF_DEBUG(DEBUG_IGMP) {
logit(LOG_DEBUG, 0, "Ignoring query from %s; querier on vif %d is still %s", logit(LOG_DEBUG, 0, "Ignoring query from %s; querier on vif %d is still %s",
skipping to change at line 744 skipping to change at line 744
g->al_timerid = SetTimer(vifi, g); g->al_timerid = SetTimer(vifi, g);
break; break;
} }
} }
/* /*
* If not found, add it to the list and update kernel cache. * If not found, add it to the list and update kernel cache.
*/ */
if (!g) { if (!g) {
g = (struct listaddr *)malloc(sizeof(struct listaddr)); g = malloc(sizeof(struct listaddr));
if (!g) { if (!g) {
logit(LOG_ERR, 0, "Malloc failed in vif.c:accept_group_report()\n"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__
/* FATAL! */ , __func__);
return; /* NOTREACHED */ return;
} }
g->al_addr = group; g->al_addr = group;
if (r_type == IGMP_V1_MEMBERSHIP_REPORT) if (r_type == IGMP_V1_MEMBERSHIP_REPORT)
g->al_old = OLD_AGE_THRESHOLD; g->al_old = OLD_AGE_THRESHOLD;
else else
g->al_old = 0; g->al_old = 0;
/** set a timer for expiration **/ /** set a timer for expiration **/
g->al_query = 0; g->al_query = 0;
skipping to change at line 1246 skipping to change at line 1246
/* /*
* Add it to our list of neighbors. * Add it to our list of neighbors.
*/ */
IF_DEBUG(DEBUG_PEER) { IF_DEBUG(DEBUG_PEER) {
logit(LOG_DEBUG, 0, "New neighbor %s on vif %d v%d.%d nf 0x%02x idx % d", logit(LOG_DEBUG, 0, "New neighbor %s on vif %d v%d.%d nf 0x%02x idx % d",
inet_fmt(addr, s1, sizeof(s1)), vifi, level & 0xff, (level >> 8 ) & 0xff, inet_fmt(addr, s1, sizeof(s1)), vifi, level & 0xff, (level >> 8 ) & 0xff,
(level >> 16) & 0xff, i); (level >> 16) & 0xff, i);
} }
n = (struct listaddr *)malloc(sizeof(struct listaddr)); n = malloc(sizeof(struct listaddr));
if (n == NULL) { if (!n) {
logit(LOG_ERR, 0, "Malloc failed in vif.c:update_neighbor()\n"); /* F logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__
ATAL! */ , __func__);
return NULL; /* NOTREACHED */ return NULL;
} }
n->al_addr = addr; n->al_addr = addr;
n->al_pv = pv; n->al_pv = pv;
n->al_mv = mv; n->al_mv = mv;
n->al_genid = has_genid ? genid : 0; n->al_genid = has_genid ? genid : 0;
n->al_index = i; n->al_index = i;
nbrs[i] = n; nbrs[i] = n;
time(&n->al_ctime); time(&n->al_ctime);
skipping to change at line 1739 skipping to change at line 1739
free(cbk); free(cbk);
} }
/* /*
* Set a timer to delete the record of a group membership on a vif. * Set a timer to delete the record of a group membership on a vif.
*/ */
static int SetTimer(vifi_t vifi, struct listaddr *g) static int SetTimer(vifi_t vifi, struct listaddr *g)
{ {
cbk_t *cbk; cbk_t *cbk;
cbk = (cbk_t *)malloc(sizeof(cbk_t)); cbk = malloc(sizeof(cbk_t));
if (!cbk) { if (!cbk) {
logit(LOG_ERR, 0, "Malloc failed in vif.c:SetTimer()\n"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__, __
return -1; /* NOTREACHED */ func__);
return -1;
} }
cbk->g = g; cbk->g = g;
cbk->vifi = vifi; cbk->vifi = vifi;
return timer_setTimer(g->al_timer, DelVif, cbk); return timer_setTimer(g->al_timer, DelVif, cbk);
} }
/* /*
* Delete a timer that was set above. * Delete a timer that was set above.
skipping to change at line 1782 skipping to change at line 1782
free(cbk); free(cbk);
} }
/* /*
* Set a timer to send a group-specific query. * Set a timer to send a group-specific query.
*/ */
static int SetQueryTimer(struct listaddr *g, vifi_t vifi, int to_expire, int q_t ime) static int SetQueryTimer(struct listaddr *g, vifi_t vifi, int to_expire, int q_t ime)
{ {
cbk_t *cbk; cbk_t *cbk;
cbk = (cbk_t *)malloc(sizeof(cbk_t)); cbk = malloc(sizeof(cbk_t));
if (!cbk) { if (!cbk) {
logit(LOG_WARNING, 0, "Malloc failed in vif.c:setQueryTimer()\n"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__, __ func__);
return -1; return -1;
} }
cbk->g = g; cbk->g = g;
cbk->q_time = q_time; cbk->q_time = q_time;
cbk->vifi = vifi; cbk->vifi = vifi;
return timer_setTimer(to_expire, SendQuery, cbk); return timer_setTimer(to_expire, SendQuery, cbk);
} }
 End of changes. 8 change blocks. 
15 lines changed or deleted 16 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS