"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "prune.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.

prune.c  (mrouted-3.9.7):prune.c  (mrouted-3.9.8)
skipping to change at line 414 skipping to change at line 414
gt->gt_prsent_timer, gt->gt_route->rt_parent, gt->gt_prsent_timer, gt->gt_route->rt_parent,
inet_fmt(gt->gt_route->rt_gateway, s3, sizeof(s3))); inet_fmt(gt->gt_route->rt_gateway, s3, sizeof(s3)));
} }
if ((v->uv_flags & VIFF_REXMIT_PRUNES) && gt->gt_rexmit_timer == 0 && if ((v->uv_flags & VIFF_REXMIT_PRUNES) && gt->gt_rexmit_timer == 0 &&
gt->gt_prsent_timer > gt->gt_prune_rexmit) { gt->gt_prsent_timer > gt->gt_prune_rexmit) {
struct gtable **arg; struct gtable **arg;
arg = malloc(sizeof(struct gtable *)); arg = malloc(sizeof(struct gtable *));
if (!arg) { if (!arg) {
logit(LOG_ERR, 0, "Malloc failed in prune.c:send_prune()\n"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__
return; /* NOTREACHED */ , __func__);
return;
} }
*arg = gt; *arg = gt;
gt->gt_rexmit_timer = timer_setTimer(JITTERED_VALUE(gt->gt_prune_rexmit), rexmit_prune, arg); gt->gt_rexmit_timer = timer_setTimer(JITTERED_VALUE(gt->gt_prune_rexmit), rexmit_prune, arg);
gt->gt_prune_rexmit *= 2; gt->gt_prune_rexmit *= 2;
} }
} }
/* /*
* a prune was sent upstream * a prune was sent upstream
skipping to change at line 582 skipping to change at line 582
} else { } else {
gtnp = &r->rt_groups; gtnp = &r->rt_groups;
while ((gt = *gtnp) != NULL) { while ((gt = *gtnp) != NULL) {
if (gt->gt_mcastgrp >= mcastgrp) if (gt->gt_mcastgrp >= mcastgrp)
break; break;
gtnp = &gt->gt_next; gtnp = &gt->gt_next;
prev_gt = gt; prev_gt = gt;
} }
} }
if (gt == NULL || gt->gt_mcastgrp != mcastgrp) { if (!gt || gt->gt_mcastgrp != mcastgrp) {
gt = malloc(sizeof(struct gtable)); gt = malloc(sizeof(struct gtable));
if (!gt) { if (!gt) {
logit(LOG_ERR, 0, "Malloc failed in prune.c:add_table_entry()\n"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__
return; /* NOTREACHED */ , __func__);
return;
} }
gt->gt_mcastgrp = mcastgrp; gt->gt_mcastgrp = mcastgrp;
gt->gt_timer = CACHE_LIFETIME(cache_lifetime); gt->gt_timer = CACHE_LIFETIME(cache_lifetime);
time(&gt->gt_ctime); time(&gt->gt_ctime);
gt->gt_prsent_timer = 0; gt->gt_prsent_timer = 0;
gt->gt_grftsnt = 0; gt->gt_grftsnt = 0;
gt->gt_srctbl = NULL; gt->gt_srctbl = NULL;
gt->gt_pruntbl = NULL; gt->gt_pruntbl = NULL;
gt->gt_route = r; gt->gt_route = r;
skipping to change at line 648 skipping to change at line 648
} }
} }
stnp = &gt->gt_srctbl; stnp = &gt->gt_srctbl;
while ((st = *stnp) != NULL) { while ((st = *stnp) != NULL) {
if (ntohl(st->st_origin) >= ntohl(origin)) if (ntohl(st->st_origin) >= ntohl(origin))
break; break;
stnp = &st->st_next; stnp = &st->st_next;
} }
if (st == NULL || st->st_origin != origin) { if (!st || st->st_origin != origin) {
st = malloc(sizeof(struct stable)); st = malloc(sizeof(struct stable));
if (!st) { if (!st) {
logit(LOG_ERR, 0, "Malloc failed in prune.c:add_table_entry()\n"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__
return; /* NOTREACHED */ , __func__);
return;
} }
st->st_origin = origin; st->st_origin = origin;
st->st_pktcnt = 0; st->st_pktcnt = 0;
st->st_savpkt = 0; st->st_savpkt = 0;
time(&st->st_ctime); time(&st->st_ctime);
st->st_next = *stnp; st->st_next = *stnp;
*stnp = st; *stnp = st;
} else { } else {
if (st->st_ctime == 0) { if (st->st_ctime == 0) {
skipping to change at line 1174 skipping to change at line 1174
if (!n) { if (!n) {
logit(LOG_WARNING, 0, "Prune from non-neighbor %s on vif %d!?", logit(LOG_WARNING, 0, "Prune from non-neighbor %s on vif %d!?",
inet_fmt(src, s1, sizeof(s1)), vifi); inet_fmt(src, s1, sizeof(s1)), vifi);
return; return;
} }
/* allocate space for the prune structure */ /* allocate space for the prune structure */
pt = malloc(sizeof(struct ptable)); pt = malloc(sizeof(struct ptable));
if (!pt) { if (!pt) {
logit(LOG_ERR, 0, "pt: ran out of memory"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FI
return; /* NOTREACHED */ LE__, __func__);
return;
} }
pt->pt_vifi = vifi; pt->pt_vifi = vifi;
pt->pt_router = src; pt->pt_router = src;
pt->pt_timer = prun_tmr; pt->pt_timer = prun_tmr;
pt->pt_next = g->gt_pruntbl; pt->pt_next = g->gt_pruntbl;
g->gt_pruntbl = pt; g->gt_pruntbl = pt;
if (n) { if (n) {
 End of changes. 6 change blocks. 
10 lines changed or deleted 14 lines changed or added

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