From 260ab6946aef1a3138e0ac3665f29a065cb402d2 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 16 Dec 2011 10:03:08 -0800 Subject: [PATCH 1/1] dpif-netdev: Correctly report types of dummy netdevs. When dpif-netdev is in use as a "dummy" datapath, the devices that are added to it have type "dummy", but the dpif methods that report the types of ports reported that they had type "system". This meant that every time the bridge code reconfigured, it would see that the ports had the wrong types and delete and re-add them, which had other undesirable effects such as flushing the entire MAC learning table whenever ovs-vsctl changed the configuration. Signed-off-by: Ben Pfaff --- lib/dpif-netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index eb101349f..2c416e357 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -458,7 +458,8 @@ answer_port_query(const struct dp_netdev_port *port, struct dpif_port *dpif_port) { dpif_port->name = xstrdup(netdev_get_name(port->netdev)); - dpif_port->type = xstrdup(port->internal ? "internal" : "system"); + dpif_port->type = xstrdup(port->internal ? "internal" + : netdev_get_type(port->netdev)); dpif_port->port_no = port->port_no; } @@ -550,7 +551,8 @@ dpif_netdev_port_dump_next(const struct dpif *dpif, void *state_, free(state->name); state->name = xstrdup(netdev_get_name(port->netdev)); dpif_port->name = state->name; - dpif_port->type = port->internal ? "internal" : "system"; + dpif_port->type = (char *) (port->internal ? "internal" + : netdev_get_type(port->netdev)); dpif_port->port_no = port->port_no; state->port_no = port_no + 1; return 0; -- 2.43.0