summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 368eecc2cf..b9a49c5190 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -70,10 +70,19 @@ static int if_zebra_speed_update(struct thread *thread)
struct zebra_if *zif = ifp->info;
uint32_t new_speed;
bool changed = false;
+ int error = 0;
zif->speed_update = NULL;
- new_speed = kernel_get_speed(ifp);
+ new_speed = kernel_get_speed(ifp, &error);
+
+ /* error may indicate vrf not available or
+ * interfaces not available.
+ * note that loopback & virtual interfaces can return 0 as speed
+ */
+ if (error < 0)
+ return 1;
+
if (new_speed != ifp->speed) {
zlog_info("%s: %s old speed: %u new speed: %u",
__PRETTY_FUNCTION__, ifp->name, ifp->speed,
@@ -2036,13 +2045,13 @@ DEFUN (link_params_enable,
/* This command could be issue at startup, when activate MPLS TE */
/* on a new interface or after a ON / OFF / ON toggle */
/* In all case, TE parameters are reset to their default factory */
- if (IS_ZEBRA_DEBUG_EVENT)
+ if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
zlog_debug(
"Link-params: enable TE link parameters on interface %s",
ifp->name);
if (!if_link_params_get(ifp)) {
- if (IS_ZEBRA_DEBUG_EVENT)
+ if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
zlog_debug(
"Link-params: failed to init TE link parameters %s",
ifp->name);
@@ -2065,8 +2074,9 @@ DEFUN (no_link_params_enable,
{
VTY_DECLVAR_CONTEXT(interface, ifp);
- zlog_debug("MPLS-TE: disable TE link parameters on interface %s",
- ifp->name);
+ if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
+ zlog_debug("MPLS-TE: disable TE link parameters on interface %s",
+ ifp->name);
if_link_params_free(ifp);