summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_addr.h2
-rw-r--r--pimd/pim_iface.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/pimd/pim_addr.h b/pimd/pim_addr.h
index 90862520af..cb868bc7e1 100644
--- a/pimd/pim_addr.h
+++ b/pimd/pim_addr.h
@@ -35,6 +35,7 @@ typedef struct in_addr pim_addr;
#define ipaddr_pim ipaddr_v4
#define PIM_MAX_BITLEN IPV4_MAX_BITLEN
#define PIM_AF_NAME "ip"
+#define PIMREG "pimreg"
#define PIM_ADDR_FUNCNAME(name) ipv4_##name
@@ -58,6 +59,7 @@ typedef struct in6_addr pim_addr;
#define ipaddr_pim ipaddr_v6
#define PIM_MAX_BITLEN IPV6_MAX_BITLEN
#define PIM_AF_NAME "ipv6"
+#define PIMREG "pim6reg"
#define PIM_ADDR_FUNCNAME(name) ipv6_##name
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index fd1806e360..4e92a2c5dc 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -1547,9 +1547,9 @@ void pim_if_create_pimreg(struct pim_instance *pim)
if (!pim->regiface) {
if (pim->vrf->vrf_id == VRF_DEFAULT)
- strlcpy(pimreg_name, "pimreg", sizeof(pimreg_name));
+ strlcpy(pimreg_name, PIMREG, sizeof(pimreg_name));
else
- snprintf(pimreg_name, sizeof(pimreg_name), "pimreg%u",
+ snprintf(pimreg_name, sizeof(pimreg_name), PIMREG "%u",
pim->vrf->data.l.table_id);
pim->regiface = if_get_by_name(pimreg_name, pim->vrf->vrf_id,
@@ -1719,7 +1719,7 @@ static int pim_ifp_up(struct interface *ifp)
* If we have a pimreg device callback and it's for a specific
* table set the master appropriately
*/
- if (sscanf(ifp->name, "pimreg%" SCNu32, &table_id) == 1) {
+ if (sscanf(ifp->name, "" PIMREG "%" SCNu32, &table_id) == 1) {
struct vrf *vrf;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((table_id == vrf->data.l.table_id)