]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/ioctl.c
Merge pull request #12544 from mjstapp/fix_pathd_sa_pcep_config
[mirror_frr.git] / zebra / ioctl.c
index facd8e318d8620848d2f54f169f3d7fb3dc7bf50..6311400251e99d6b3a7d78017786922f93a332a5 100644 (file)
@@ -48,6 +48,7 @@ void ifreq_set_name(struct ifreq *ifreq, struct interface *ifp)
        strlcpy(ifreq->ifr_name, ifp->name, sizeof(ifreq->ifr_name));
 }
 
+#ifndef HAVE_NETLINK
 /* call ioctl system call */
 int if_ioctl(unsigned long request, caddr_t buffer)
 {
@@ -73,6 +74,7 @@ int if_ioctl(unsigned long request, caddr_t buffer)
        }
        return 0;
 }
+#endif
 
 /* call ioctl system call */
 int vrf_if_ioctl(unsigned long request, caddr_t buffer, vrf_id_t vrf_id)
@@ -127,7 +129,6 @@ static int if_ioctl_ipv6(unsigned long request, caddr_t buffer)
        }
        return 0;
 }
-#endif /* ! HAVE_NETLINK */
 
 /*
  * get interface metric
@@ -159,7 +160,8 @@ void if_get_mtu(struct interface *ifp)
 
 #if defined(SIOCGIFMTU)
        if (vrf_if_ioctl(SIOCGIFMTU, (caddr_t)&ifreq, ifp->vrf->vrf_id) < 0) {
-               zlog_info("Can't lookup mtu by ioctl(SIOCGIFMTU)");
+               zlog_info("Can't lookup mtu by ioctl(SIOCGIFMTU) for %s(%u)",
+                         ifp->name, ifp->vrf->vrf_id);
                ifp->mtu6 = ifp->mtu = -1;
                return;
        }
@@ -170,10 +172,12 @@ void if_get_mtu(struct interface *ifp)
        zebra_interface_up_update(ifp);
 
 #else
-       zlog_info("Can't lookup mtu on this system");
+       zlog_info("Can't lookup mtu on this system for %s(%u)", ifp->name,
+                 ifp->vrf->vrf_id);
        ifp->mtu6 = ifp->mtu = -1;
 #endif
 }
+#endif /* ! HAVE_NETLINK */
 
 /*
  * Handler for interface address programming via the zebra dplane,
@@ -217,13 +221,6 @@ enum zebra_dplane_result kernel_address_update_ctx(
                ZEBRA_DPLANE_REQUEST_SUCCESS : ZEBRA_DPLANE_REQUEST_FAILURE);
 }
 
-#endif /* !HAVE_NETLINK */
-
-#ifdef HAVE_NETLINK
-
-/* TODO -- remove; no use of these apis with netlink any longer */
-
-#else /* ! HAVE_NETLINK */
 #ifdef HAVE_STRUCT_IFALIASREQ
 
 /*
@@ -517,7 +514,8 @@ int if_set_flags(struct interface *ifp, uint64_t flags)
        ret = vrf_if_ioctl(SIOCSIFFLAGS, (caddr_t)&ifreq, ifp->vrf->vrf_id);
 
        if (ret < 0) {
-               zlog_info("can't set interface flags");
+               zlog_info("can't set interface %s(%u) flags %" PRIu64,
+                         ifp->name, ifp->vrf->vrf_id, flags);
                return ret;
        }
        return 0;
@@ -538,7 +536,8 @@ int if_unset_flags(struct interface *ifp, uint64_t flags)
        ret = vrf_if_ioctl(SIOCSIFFLAGS, (caddr_t)&ifreq, ifp->vrf->vrf_id);
 
        if (ret < 0) {
-               zlog_info("can't unset interface flags");
+               zlog_warn("can't unset interface %s(%u) flags %" PRIu64,
+                         ifp->name, ifp->vrf->vrf_id, flags);
                return ret;
        }
        return 0;