pimd: Create the pimreg device name correctly

The pimreg device name should be based upon the
tableid we create( as that this is what the kernel does )

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-05-19 09:14:06 -04:00
parent 44a1bd88ee
commit afa2b17920

View File

@ -1561,10 +1561,17 @@ void pim_if_update_assert_tracking_desired(struct interface *ifp)
*/
void pim_if_create_pimreg(struct pim_instance *pim)
{
char pimreg_name[100];
if (!pim->regiface) {
pim->regiface =
if_create("pimreg", strlen("pimreg"), pim->vrf_id);
if (pim->vrf_id == VRF_DEFAULT)
strcpy(pimreg_name, "pimreg");
else
sprintf(pimreg_name, "pimreg%d",
pim->vrf->data.l.table_id);
pim->regiface = if_create(pimreg_name, strlen(pimreg_name),
pim->vrf_id);
pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
pim_if_new(pim->regiface, 0, 0);