Skip to content

Commit

Permalink
Bugfix: Use configured (*,G) route's outbound interfaces for on-deman…
Browse files Browse the repository at this point in the history
…d routes.
  • Loading branch information
troglobit committed May 10, 2012
1 parent 20cb3fc commit 9fbbc73
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mroute-api.c
Expand Up @@ -236,10 +236,10 @@ static int __mroute4_add (mroute4_t *ptr)
mc.mfcc_parent = ptr->inbound; mc.mfcc_parent = ptr->inbound;


/* copy the TTL vector */ /* copy the TTL vector */
if (sizeof(mc.mfcc_ttls) != sizeof(ptr->ttl) || ARRAY_ELEMENTS(mc.mfcc_ttls) != ARRAY_ELEMENTS(ptr->ttl)) if (sizeof(mc.mfcc_ttls[0]) != sizeof(ptr->ttl[0]) || ARRAY_ELEMENTS(mc.mfcc_ttls) != ARRAY_ELEMENTS(ptr->ttl))
smclog(LOG_ERR, 0, "Data types does not match in %s, source adaption needed!", __FILE__); smclog(LOG_ERR, 0, "Data types does not match in %s, source adaption needed!", __FILE__);


memcpy(mc.mfcc_ttls, ptr->ttl, sizeof(mc.mfcc_ttls)); memcpy(mc.mfcc_ttls, ptr->ttl, ARRAY_ELEMENTS(mc.mfcc_ttls) * sizeof(mc.mfcc_ttls[0]));


smclog(LOG_NOTICE, 0, "Add MFC: %s -> %s, inbound VIF: %d", smclog(LOG_NOTICE, 0, "Add MFC: %s -> %s, inbound VIF: %d",
inet_ntop(AF_INET, &mc.mfcc_origin, origin, INET_ADDRSTRLEN), inet_ntop(AF_INET, &mc.mfcc_origin, origin, INET_ADDRSTRLEN),
Expand Down Expand Up @@ -291,6 +291,9 @@ int mroute4_dyn_add(mroute4_t *ptr)
if (!memcmp (&entry->group, &ptr->group, sizeof(entry->group)) && entry->inbound == ptr->inbound) { if (!memcmp (&entry->group, &ptr->group, sizeof(entry->group)) && entry->inbound == ptr->inbound) {
smclog(LOG_DEBUG, 0, "Found (*,G) match for (0x%x, 0x%x)!", ptr->sender.s_addr, ptr->group.s_addr); smclog(LOG_DEBUG, 0, "Found (*,G) match for (0x%x, 0x%x)!", ptr->sender.s_addr, ptr->group.s_addr);


/* Use configured template (*,G) outbound interfaces. */
memcpy(ptr->ttl, entry->ttl, ARRAY_ELEMENTS(ptr->ttl) * sizeof(ptr->ttl[0]));

/* Add to list of dynamically added routes. Necessary if the user /* Add to list of dynamically added routes. Necessary if the user
* removes the (*,G) using the command line interface rather than * removes the (*,G) using the command line interface rather than
* updating the conf file and SIGHUP. Note: if we fail to alloc() * updating the conf file and SIGHUP. Note: if we fail to alloc()
Expand Down

0 comments on commit 9fbbc73

Please sign in to comment.