]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Use macro for pimreg interface 13439/head
authoranlan_cs <vic.lan@pica8.com>
Fri, 5 May 2023 06:51:50 +0000 (14:51 +0800)
committeranlan_cs <vic.lan@pica8.com>
Thu, 11 May 2023 05:52:25 +0000 (13:52 +0800)
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 <vic.lan@pica8.com>
pimd/pim_iface.c

index b053e422ec7f7a34f510505be16a6c368ff0c441..b1beb456303ad7ef4d50b1a8e792315ea61064a4 100644 (file)
@@ -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;
        }