From f403844a1280e648de00199ced50803d497e8da8 Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Fri, 5 May 2023 14:51:50 +0800 Subject: [PATCH] pimd: Use macro for pimreg interface Some interfaces are special, they have the same `ifindex` with pimreg. Use macro for `ifindex` of pimreg. And adjust log. Signed-off-by: anlan_cs --- pimd/pim_iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index b053e422ec..b1beb45630 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -979,13 +979,13 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term) } if (ifp->ifindex < 0) { - zlog_warn("%s: ifindex=%d < 1 on interface %s", __func__, + zlog_warn("%s: ifindex=%d < 0 on interface %s", __func__, ifp->ifindex, ifp->name); return -2; - } else if ((ifp->ifindex == 0) && + } else if ((ifp->ifindex == PIM_OIF_PIM_REGISTER_VIF) && ((strncmp(ifp->name, "pimreg", 6)) && (strncmp(ifp->name, "pim6reg", 7)))) { - zlog_warn("%s: ifindex=%d == 0 on interface %s", __func__, + zlog_warn("%s: ifindex=%d on interface %s", __func__, ifp->ifindex, ifp->name); return -2; }