From d4c2000bb24318b7a5e7cbf349ba107dd9c2cbe4 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Sat, 20 Feb 2010 23:00:32 -0800 Subject: [PATCH] bridge: Map an "internal" config device type to a "system" netdev type ovs-vswitchd has a concept of an "internal" port, which is created on-demand. The netdev library doesn't understand an "internal" device type, so we map it to a "system" one. Bug #2431 --- vswitchd/bridge.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 63b0c9b2..6440bb9a 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -417,7 +417,12 @@ set_up_iface(const struct ovsrec_interface *iface_cfg, struct iface *iface, memset(&netdev_options, 0, sizeof netdev_options); netdev_options.name = iface_cfg->name; - netdev_options.type = iface_cfg->type; + if (!strcmp(iface_cfg->type, "internal")) { + /* An "internal" config type maps to a netdev "system" type. */ + netdev_options.type = "system"; + } else { + netdev_options.type = iface_cfg->type; + } netdev_options.args = &options; netdev_options.ethertype = NETDEV_ETH_TYPE_NONE; netdev_options.may_create = true; @@ -435,6 +440,11 @@ set_up_iface(const struct ovsrec_interface *iface_cfg, struct iface *iface, const char *iface_type = iface_cfg->type && strlen(iface_cfg->type) ? iface_cfg->type : NULL; + /* An "internal" config type maps to a netdev "system" type. */ + if (iface_type && !strcmp(iface_type, "internal")) { + iface_type = "system"; + } + if (!iface_type || !strcmp(netdev_type, iface_type)) { error = netdev_reconfigure(iface->netdev, &options); } else { -- 2.30.2