]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: do not update link if interface is veth interface 2923/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 29 Aug 2018 09:29:07 +0000 (11:29 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 29 Aug 2018 09:34:08 +0000 (11:34 +0200)
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>
zebra/if_netlink.c
zebra/interface.c
zebra/interface.h

index 2b9e8a589c884d8c2951407ed3819e4422ba1159..0dcf5082a2c9f376865ea58a7031ec40549058fe 100644 (file)
@@ -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)                                      \
index 8558a8bd59b7e19b8ef96c5b310c5baadb8caa4d..32ee1a566aeaf04a0c02808ffb382325924ae01a 100644 (file)
@@ -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;
index bb39ac5e67af3fe77ccaf75ced25a277acf920eb..956d430cf9e9c2d5d24fb5d22561ec450aa89fa9 100644 (file)
@@ -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)