Permalink
Browse files

Bugfix: Use configured (*,G) route's outbound interfaces for on-deman…

…d routes.
  • Loading branch information...
troglobit committed May 10, 2012
1 parent 20cb3fc commit 9fbbc7375bcb00182ffcc06ae46f6c9c385cfa99
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/mroute-api.c
View
@@ -236,10 +236,10 @@ static int __mroute4_add (mroute4_t *ptr)
mc.mfcc_parent = ptr->inbound;
/* 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__);
- 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",
inet_ntop(AF_INET, &mc.mfcc_origin, origin, INET_ADDRSTRLEN),
@@ -291,6 +291,9 @@ int mroute4_dyn_add(mroute4_t *ptr)
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);
+ /* 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
* removes the (*,G) using the command line interface rather than
* updating the conf file and SIGHUP. Note: if we fail to alloc()

0 comments on commit 9fbbc73

Please sign in to comment.