[ovs-dev] [cleanups 04/12] bridge: Open internal ports with the correct type.
Justin Pettit
jpettit at nicira.com
Fri Nov 16 08:02:57 UTC 2012
Use the new ofproto function that returns how a port should be opened
based on the datapath type. This fixes a problem with internal ports
being attached to userspace datapaths.
Signed-off-by: Justin Pettit <jpettit at nicira.com>
---
vswitchd/bridge.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 9fe7750..dbce59a 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3141,14 +3141,18 @@ static const char *
iface_get_type(const struct ovsrec_interface *iface,
const struct ovsrec_bridge *br)
{
- /* The local port always has type "internal" unless the bridge is of
- * type "dummy". Other ports take their type from the database and
- * default to "system" if none is specified. */
+ const char *type;
+
+ /* The local port always has type "internal". Other ports take
+ * their type from the database and default to "system" if none is
+ * specified. */
if (!strcmp(iface->name, br->name)) {
- return !strcmp(br->datapath_type, "dummy") ? "dummy" : "internal";
+ type = "internal";
} else {
- return iface->type[0] ? iface->type : "system";
+ type = iface->type[0] ? iface->type : "system";
}
+
+ return ofproto_port_open_type(br->datapath_type, type);
}
static void
--
1.7.5.4
More information about the dev
mailing list