summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2018-08-27 22:13:30 +0000
committervivek <vivek@cumulusnetworks.com>2018-08-27 22:13:30 +0000
commitf190902f523abaa1035cbbb385387bc6c72dd1dc (patch)
tree9472de5fb49314eba45868ed7b66376f7329b2fe /lib/if.c
parent9df2b997b975c7a7807e9e491989d5123d87458f (diff)
parent95d8c3ce78cdd800f4c39d196e865c2ec9213f03 (diff)
Merge remote-tracking branch 'upstream/master' into evpn-extended-mobility
Conflicts: zebra/zebra_vxlan.c
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/if.c b/lib/if.c
index 6023624dc1..2bf0c6e6b5 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -393,7 +393,8 @@ struct interface *if_get_by_name(const char *name, vrf_id_t vrf_id, int vty)
* this should not be considered as an update
* then create the new interface
*/
- if (ifp->vrf_id != vrf_id && vrf_is_mapped_on_netns(vrf_id))
+ if (ifp->vrf_id != vrf_id && vrf_is_mapped_on_netns(
+ vrf_lookup_by_id(vrf_id)))
return if_create(name, vrf_id);
/* If it came from the kernel
* or by way of zclient, believe it and update
@@ -471,6 +472,14 @@ int if_is_vrf(struct interface *ifp)
return CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
}
+bool if_is_loopback_or_vrf(struct interface *ifp)
+{
+ if (if_is_loopback(ifp) || if_is_vrf(ifp))
+ return true;
+
+ return false;
+}
+
/* Does this interface support broadcast ? */
int if_is_broadcast(struct interface *ifp)
{
@@ -1140,7 +1149,7 @@ const char *if_link_type_str(enum zebra_link_type llt)
llts(ZEBRA_LLT_IEEE802154, "IEEE 802.15.4");
llts(ZEBRA_LLT_IEEE802154_PHY, "IEEE 802.15.4 Phy");
default:
- zlog_warn("Unknown value %d", llt);
+ flog_err(LIB_ERR_DEVELOPMENT, "Unknown value %d", llt);
return "Unknown type!";
#undef llts
}