diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-08-29 11:29:07 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-08-29 11:34:08 +0200 |
commit | 0e4864eaf0dfd5d883d8192a905405b9a72af68e (patch) | |
tree | 8adeb4e6602bec1cd545679e89d24ac0aecdeeab /zebra | |
parent | zebra: when veth link is used across vrf, the link may not be good (diff) | |
download | frr-0e4864eaf0dfd5d883d8192a905405b9a72af68e.tar.xz frr-0e4864eaf0dfd5d883d8192a905405b9a72af68e.zip |
zebra: do not update link if interface is veth interface
when interface is a virtual ethernet interface, then there is no need to
update link pointer of interface.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/if_netlink.c | 2 | ||||
-rw-r--r-- | zebra/interface.c | 6 | ||||
-rw-r--r-- | zebra/interface.h | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 2b9e8a589..0dcf5082a 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -259,6 +259,8 @@ static void netlink_determine_zebra_iftype(char *kind, zebra_iftype_t *zif_type) *zif_type = ZEBRA_IF_VXLAN; else if (strcmp(kind, "macvlan") == 0) *zif_type = ZEBRA_IF_MACVLAN; + else if (strcmp(kind, "veth") == 0) + *zif_type = ZEBRA_IF_VETH; } #define parse_rtattr_nested(tb, max, rta) \ diff --git a/zebra/interface.c b/zebra/interface.c index 8558a8bd5..32ee1a566 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1007,6 +1007,8 @@ void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex, { struct zebra_if *zif; + if (IS_ZEBRA_IF_VETH(ifp)) + return; zif = (struct zebra_if *)ifp->info; zif->link_ifindex = link_ifindex; zif->link = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), @@ -1094,6 +1096,10 @@ static const char *zebra_ziftype_2str(zebra_iftype_t zif_type) return "VRF"; break; + case ZEBRA_IF_VETH: + return "VETH"; + break; + default: return "Unknown"; break; diff --git a/zebra/interface.h b/zebra/interface.h index bb39ac5e6..956d430cf 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -191,6 +191,7 @@ typedef enum { ZEBRA_IF_BRIDGE, /* bridge device */ ZEBRA_IF_VLAN, /* VLAN sub-interface */ ZEBRA_IF_MACVLAN, /* MAC VLAN interface*/ + ZEBRA_IF_VETH, /* VETH interface*/ } zebra_iftype_t; /* Zebra "slave" interface type */ @@ -312,7 +313,10 @@ static inline void zebra_if_set_ziftype(struct interface *ifp, #define IS_ZEBRA_IF_MACVLAN(ifp) \ (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_MACVLAN) -#define IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) \ +#define IS_ZEBRA_IF_VETH(ifp) \ + (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VETH) + +#define IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) \ (((struct zebra_if *)(ifp->info))->zif_slave_type \ == ZEBRA_IF_SLAVE_BRIDGE) |