pimd: API for enabling pim on the vxlan term device ipmr-lo

ipmr-lo is a dummy netdev with no additional addressing requirements -
root@TORS1:~# ip -d link show ipmr-lo
28: ipmr-lo: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 12:5a:ae:74:51:a2 brd ff:ff:ff:ff:ff:ff promiscuity 0
    dummy addrgenmode eui64
root@TORS1:~#

This device is used by pim-vxlan to signify multicast-vxlan-tunnel
termination.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
Anuradha Karuppiah 2019-03-22 09:48:17 -07:00
parent ee31c9fd1a
commit b1891fa084
4 changed files with 16 additions and 12 deletions

View File

@ -5788,7 +5788,8 @@ static int pim_cmd_igmp_start(struct vty *vty, struct interface *ifp)
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
pim_ifp = pim_if_new(ifp, true, false, false); pim_ifp = pim_if_new(ifp, true, false, false,
false /*vxlan_term*/);
if (!pim_ifp) { if (!pim_ifp) {
vty_out(vty, "Could not enable IGMP on interface %s\n", vty_out(vty, "Could not enable IGMP on interface %s\n",
ifp->name); ifp->name);
@ -6399,7 +6400,8 @@ static int pim_cmd_interface_add(struct interface *ifp)
struct pim_interface *pim_ifp = ifp->info; struct pim_interface *pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
pim_ifp = pim_if_new(ifp, false, true, false); pim_ifp = pim_if_new(ifp, false, true, false,
false /*vxlan_term*/);
if (!pim_ifp) { if (!pim_ifp) {
return 0; return 0;
} }

View File

@ -109,7 +109,7 @@ static int pim_sec_addr_comp(const void *p1, const void *p2)
} }
struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim, struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
bool ispimreg) bool ispimreg, bool is_vxlan_term)
{ {
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
@ -178,7 +178,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
pim_sock_reset(ifp); pim_sock_reset(ifp);
pim_if_add_vif(ifp, ispimreg); pim_if_add_vif(ifp, ispimreg, is_vxlan_term);
return pim_ifp; return pim_ifp;
} }
@ -628,7 +628,7 @@ void pim_if_addr_add(struct connected *ifc)
address assigned, then try to create a vif_index. address assigned, then try to create a vif_index.
*/ */
if (pim_ifp->mroute_vif_index < 0) { if (pim_ifp->mroute_vif_index < 0) {
pim_if_add_vif(ifp, false); pim_if_add_vif(ifp, false, false /*vxlan_term*/);
} }
pim_ifchannel_scan_forward_start(ifp); pim_ifchannel_scan_forward_start(ifp);
} }
@ -761,7 +761,7 @@ void pim_if_addr_add_all(struct interface *ifp)
* address assigned, then try to create a vif_index. * address assigned, then try to create a vif_index.
*/ */
if (pim_ifp->mroute_vif_index < 0) { if (pim_ifp->mroute_vif_index < 0) {
pim_if_add_vif(ifp, false); pim_if_add_vif(ifp, false, false /*vxlan_term*/);
} }
pim_ifchannel_scan_forward_start(ifp); pim_ifchannel_scan_forward_start(ifp);
@ -926,7 +926,7 @@ static int pim_iface_next_vif_index(struct interface *ifp)
see also pim_if_find_vifindex_by_ifindex() see also pim_if_find_vifindex_by_ifindex()
*/ */
int pim_if_add_vif(struct interface *ifp, bool ispimreg) int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)
{ {
struct pim_interface *pim_ifp = ifp->info; struct pim_interface *pim_ifp = ifp->info;
struct in_addr ifaddr; struct in_addr ifaddr;
@ -948,7 +948,7 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg)
} }
ifaddr = pim_ifp->primary_address; ifaddr = pim_ifp->primary_address;
if (!ispimreg && PIM_INADDR_IS_ANY(ifaddr)) { if (!ispimreg && !is_vxlan_term && PIM_INADDR_IS_ANY(ifaddr)) {
zlog_warn( zlog_warn(
"%s: could not get address for interface %s ifindex=%d", "%s: could not get address for interface %s ifindex=%d",
__PRETTY_FUNCTION__, ifp->name, ifp->ifindex); __PRETTY_FUNCTION__, ifp->name, ifp->ifindex);
@ -1469,7 +1469,8 @@ void pim_if_create_pimreg(struct pim_instance *pim)
pim->regiface = if_create(pimreg_name, pim->vrf_id); pim->regiface = if_create(pimreg_name, pim->vrf_id);
pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF; pim->regiface->ifindex = PIM_OIF_PIM_REGISTER_VIF;
pim_if_new(pim->regiface, false, false, true); pim_if_new(pim->regiface, false, false, true,
false /*vxlan_term*/);
} }
} }

View File

@ -158,7 +158,7 @@ void pim_if_init(struct pim_instance *pim);
void pim_if_terminate(struct pim_instance *pim); void pim_if_terminate(struct pim_instance *pim);
struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim, struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
bool ispimreg); bool ispimreg, bool is_vxlan_term);
void pim_if_delete(struct interface *ifp); void pim_if_delete(struct interface *ifp);
void pim_if_addr_add(struct connected *ifc); void pim_if_addr_add(struct connected *ifc);
void pim_if_addr_del(struct connected *ifc, int force_prim_as_any); void pim_if_addr_del(struct connected *ifc, int force_prim_as_any);
@ -167,7 +167,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_igmp(struct interface *ifp);
void pim_if_addr_del_all_pim(struct interface *ifp); void pim_if_addr_del_all_pim(struct interface *ifp);
int pim_if_add_vif(struct interface *ifp, bool ispimreg); int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term);
int pim_if_del_vif(struct interface *ifp); int pim_if_del_vif(struct interface *ifp);
void pim_if_add_vif_all(struct pim_instance *pim); void pim_if_add_vif_all(struct pim_instance *pim);
void pim_if_del_vif_all(struct pim_instance *pim); void pim_if_del_vif_all(struct pim_instance *pim);

View File

@ -111,7 +111,8 @@ static int pim_zebra_if_add(int command, struct zclient *zclient,
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
if (!ifp->info) { if (!ifp->info) {
pim_ifp = pim_if_new(ifp, false, false, false); pim_ifp = pim_if_new(ifp, false, false, false,
false /*vxlan_term*/);
ifp->info = pim_ifp; ifp->info = pim_ifp;
} }