Skip to content

Commit

Permalink
Merge pull request #3047 from donaldsharp/pim_5.0
Browse files Browse the repository at this point in the history
pimd: Actually create vif's in non-integrated config
  • Loading branch information
mwinter-osr committed Sep 20, 2018
2 parents a8f0c2d + 4801295 commit 1cf5f01
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
6 changes: 4 additions & 2 deletions pimd/pim_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5694,7 +5694,8 @@ static int pim_cmd_igmp_start(struct vty *vty, struct interface *ifp)
pim_ifp = ifp->info;

if (!pim_ifp) {
pim_ifp = pim_if_new(ifp, 1 /* igmp=true */, 0 /* pim=false */);
pim_ifp = pim_if_new(ifp, 1 /* igmp=true */, 0 /* pim=false */,
false);
if (!pim_ifp) {
vty_out(vty, "Could not enable IGMP on interface %s\n",
ifp->name);
Expand Down Expand Up @@ -6305,7 +6306,8 @@ static int pim_cmd_interface_add(struct interface *ifp)
struct pim_interface *pim_ifp = ifp->info;

if (!pim_ifp) {
pim_ifp = pim_if_new(ifp, 0 /* igmp=false */, 1 /* pim=true */);
pim_ifp = pim_if_new(ifp, 0 /* igmp=false */, 1 /* pim=true */,
false);
if (!pim_ifp) {
return 0;
}
Expand Down
16 changes: 8 additions & 8 deletions pimd/pim_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ static int pim_sec_addr_comp(const void *p1, const void *p2)
return 0;
}

struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim,
bool ispimreg)
{
struct pim_interface *pim_ifp;

Expand Down Expand Up @@ -219,7 +220,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)

pim_sock_reset(ifp);

pim_if_add_vif(ifp);
pim_if_add_vif(ifp, ispimreg);

return pim_ifp;
}
Expand Down Expand Up @@ -672,7 +673,7 @@ void pim_if_addr_add(struct connected *ifc)
address assigned, then try to create a vif_index.
*/
if (pim_ifp->mroute_vif_index < 0) {
pim_if_add_vif(ifp);
pim_if_add_vif(ifp, false);
}
pim_ifchannel_scan_forward_start(ifp);
}
Expand Down Expand Up @@ -805,7 +806,7 @@ void pim_if_addr_add_all(struct interface *ifp)
* address assigned, then try to create a vif_index.
*/
if (pim_ifp->mroute_vif_index < 0) {
pim_if_add_vif(ifp);
pim_if_add_vif(ifp, false);
}
pim_ifchannel_scan_forward_start(ifp);

Expand Down Expand Up @@ -970,7 +971,7 @@ static int pim_iface_next_vif_index(struct interface *ifp)
see also pim_if_find_vifindex_by_ifindex()
*/
int pim_if_add_vif(struct interface *ifp)
int pim_if_add_vif(struct interface *ifp, bool ispimreg)
{
struct pim_interface *pim_ifp = ifp->info;
struct in_addr ifaddr;
Expand All @@ -992,8 +993,7 @@ int pim_if_add_vif(struct interface *ifp)
}

ifaddr = pim_ifp->primary_address;
if (ifp->ifindex != PIM_OIF_PIM_REGISTER_VIF
&& PIM_INADDR_IS_ANY(ifaddr)) {
if (!ispimreg && PIM_INADDR_IS_ANY(ifaddr)) {
zlog_warn(
"%s: could not get address for interface %s ifindex=%d",
__PRETTY_FUNCTION__, ifp->name, ifp->ifindex);
Expand Down Expand Up @@ -1520,7 +1520,7 @@ void pim_if_create_pimreg(struct pim_instance *pim)
pim->regiface = if_create(pimreg_name, pim->vrf_id);
pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;

pim_if_new(pim->regiface, 0, 0);
pim_if_new(pim->regiface, 0, 0, true);
}
}

Expand Down
5 changes: 3 additions & 2 deletions pimd/pim_iface.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ struct pim_interface {
void pim_if_init(struct pim_instance *pim);
void pim_if_terminate(struct pim_instance *pim);

struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim);
struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim,
bool ispimreg);
void pim_if_delete(struct interface *ifp);
void pim_if_addr_add(struct connected *ifc);
void pim_if_addr_del(struct connected *ifc, int force_prim_as_any);
Expand All @@ -163,7 +164,7 @@ void pim_if_addr_del_all(struct interface *ifp);
void pim_if_addr_del_all_igmp(struct interface *ifp);
void pim_if_addr_del_all_pim(struct interface *ifp);

int pim_if_add_vif(struct interface *ifp);
int pim_if_add_vif(struct interface *ifp, bool ispimreg);
int pim_if_del_vif(struct interface *ifp);
void pim_if_add_vif_all(struct pim_instance *pim);
void pim_if_del_vif_all(struct pim_instance *pim);
Expand Down
2 changes: 1 addition & 1 deletion pimd/pim_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int pim_zebra_if_add(int command, struct zclient *zclient,
struct pim_interface *pim_ifp;

if (!ifp->info) {
pim_ifp = pim_if_new(ifp, 0, 0);
pim_ifp = pim_if_new(ifp, 0, 0, false);
ifp->info = pim_ifp;
}

Expand Down

0 comments on commit 1cf5f01

Please sign in to comment.