diff options
| -rw-r--r-- | zebra/rt_netlink.c | 19 | ||||
| -rw-r--r-- | zebra/zebra_mroute.c | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 46198bbf52..b600a7db50 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1767,6 +1767,7 @@ skip: int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *in) { + uint32_t actual_table; int suc = 0; struct mcast_route_data *mr = (struct mcast_route_data *)in; struct { @@ -1792,7 +1793,23 @@ int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *in) addattr_l(&req.n, sizeof(req), RTA_OIF, &mroute->ifindex, 4); addattr_l(&req.n, sizeof(req), RTA_SRC, &mroute->sg.src.s_addr, 4); addattr_l(&req.n, sizeof(req), RTA_DST, &mroute->sg.grp.s_addr, 4); - addattr_l(&req.n, sizeof(req), RTA_TABLE, &zvrf->table_id, 4); + /* + * What? + * + * So during the namespace cleanup we started storing + * the zvrf table_id for the default table as RT_TABLE_MAIN + * which is what the normal routing table for ip routing is. + * This change caused this to break our lookups of sg data + * because prior to this change the zvrf->table_id was 0 + * and when the pim multicast kernel code saw a 0, + * it was auto-translated to RT_TABLE_DEFAULT. But since + * we are now passing in RT_TABLE_MAIN there is no auto-translation + * and the kernel goes screw you and the delicious cookies you + * are trying to give me. So now we have this little hack. + */ + actual_table = (zvrf->table_id == RT_TABLE_MAIN) ? RT_TABLE_DEFAULT : + zvrf->table_id; + addattr_l(&req.n, sizeof(req), RTA_TABLE, &actual_table, 4); suc = netlink_talk(netlink_route_change_read_multicast, &req.n, &zns->netlink_cmd, zns, 0); diff --git a/zebra/zebra_mroute.c b/zebra/zebra_mroute.c index 3af3cd5bb2..583b666e66 100644 --- a/zebra/zebra_mroute.c +++ b/zebra/zebra_mroute.c @@ -50,7 +50,8 @@ void zebra_ipmr_route_stats(ZAPI_HANDLER_ARGS) strlcpy(sbuf, inet_ntoa(mroute.sg.src), sizeof(sbuf)); strlcpy(gbuf, inet_ntoa(mroute.sg.grp), sizeof(gbuf)); - zlog_debug("Asking for (%s,%s) mroute information", sbuf, gbuf); + zlog_debug("Asking for (%s,%s)[%s(%u)] mroute information", + sbuf, gbuf, zvrf->vrf->name, zvrf->vrf->vrf_id); } suc = kernel_get_ipmr_sg_stats(zvrf, &mroute); |
