summaryrefslogtreecommitdiffstats
path: root/pimd/pim_mroute.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-14 20:33:53 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:51:34 +0200
commitea3d967be001d54c2cda0e35ed3527bda61c762c (patch)
tree538d16a5a6b1729b335dad54433197dcd2e0ac35 /pimd/pim_mroute.c
parentpimd: Store the pim instance off of the pim interface (diff)
downloadfrr-ea3d967be001d54c2cda0e35ed3527bda61c762c.tar.xz
frr-ea3d967be001d54c2cda0e35ed3527bda61c762c.zip
pimd: pim_mroute_[add|del]_vif become VRF aware
Make the pim_mroute_[add|del]_vif functions be vrf aware. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_mroute.c')
-rw-r--r--pimd/pim_mroute.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index fb216bcfb..bb4086972 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -782,7 +782,7 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,
}
#endif
- err = setsockopt(pimg->mroute_socket, IPPROTO_IP, MRT_ADD_VIF,
+ err = setsockopt(pim_ifp->pim->mroute_socket, IPPROTO_IP, MRT_ADD_VIF,
(void *)&vc, sizeof(vc));
if (err) {
char ifaddr_str[INET_ADDRSTRLEN];
@@ -792,37 +792,37 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,
zlog_warn(
"%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_VIF,vif_index=%d,ifaddr=%s,flag=%d): errno=%d: %s",
- __FILE__, __PRETTY_FUNCTION__, pimg->mroute_socket,
- ifp->ifindex, ifaddr_str, flags, errno,
- safe_strerror(errno));
+ __FILE__, __PRETTY_FUNCTION__,
+ pim_ifp->pim->mroute_socket, ifp->ifindex, ifaddr_str,
+ flags, errno, safe_strerror(errno));
return -2;
}
return 0;
}
-int pim_mroute_del_vif(int vif_index)
+int pim_mroute_del_vif(struct interface *ifp)
{
+ struct pim_interface *pim_ifp = ifp->info;
struct vifctl vc;
int err;
- if (PIM_DEBUG_MROUTE) {
- struct interface *ifp = pim_if_find_by_vif_index(vif_index);
+ if (PIM_DEBUG_MROUTE)
zlog_debug("%s %s: Del Vif %d (%s) ", __FILE__,
- __PRETTY_FUNCTION__, vif_index,
- ifp ? ifp->name : "NULL");
- }
+ __PRETTY_FUNCTION__, pim_ifp->mroute_vif_index,
+ ifp->name);
memset(&vc, 0, sizeof(vc));
- vc.vifc_vifi = vif_index;
+ vc.vifc_vifi = pim_ifp->mroute_vif_index;
- err = setsockopt(pimg->mroute_socket, IPPROTO_IP, MRT_DEL_VIF,
+ err = setsockopt(pim_ifp->pim->mroute_socket, IPPROTO_IP, MRT_DEL_VIF,
(void *)&vc, sizeof(vc));
if (err) {
zlog_warn(
"%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_VIF,vif_index=%d): errno=%d: %s",
- __FILE__, __PRETTY_FUNCTION__, pimg->mroute_socket,
- vif_index, errno, safe_strerror(errno));
+ __FILE__, __PRETTY_FUNCTION__,
+ pim_ifp->pim->mroute_socket, pim_ifp->mroute_vif_index,
+ errno, safe_strerror(errno));
return -2;
}