From: Ben Pfaff Date: Fri, 16 Dec 2011 18:03:08 +0000 (-0800) Subject: dpif-netdev: Correctly report types of dummy netdevs. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85807ff311923146b46dd3cfc11fdc7a8972612e;p=openvswitch 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 --- diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index eb101349..2c416e35 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;