From fe4838bc70077fa8350b05cad77c7ce658ad2285 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Wed, 1 Dec 2010 18:03:44 -0800 Subject: [PATCH] vswitch: Remove unnecessary iface_get_options function Since GRE-over-IPsec is a proper tunnel type and no longer configured through "other_config", we can remove this function that folded an interface's "other_confg" into "options". --- vswitchd/bridge.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index f739505e3..96a24fd96 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -395,30 +395,6 @@ bridge_configure_once(const struct ovsrec_open_vswitch *cfg) svec_destroy(&dpif_types); } -/* Initializes 'options' and fills it with the options for 'if_cfg'. Merges - * keys from "options" and "other_config", preferring "options" keys over - * "other_config" keys. */ -static void -iface_get_options(const struct ovsrec_interface *if_cfg, struct shash *options) -{ - size_t i; - - shash_from_ovs_idl_map(if_cfg->key_options, if_cfg->value_options, - if_cfg->n_options, options); - - for (i = 0; i < if_cfg->n_other_config; i++) { - char *key = if_cfg->key_other_config[i]; - char *value = if_cfg->value_other_config[i]; - - if (!shash_find_data(options, key)) { - shash_add(options, key, value); - } else { - VLOG_WARN("%s: ignoring \"other_config\" key %s that conflicts " - "with \"options\" key %s", if_cfg->name, key, key); - } - } -} - /* Callback for iterate_and_prune_ifaces(). */ static bool check_iface(struct bridge *br, struct iface *iface, void *aux OVS_UNUSED) @@ -695,7 +671,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg) shash_init(&args); if (iface) { - iface_get_options(iface->cfg, &args); + shash_from_ovs_idl_map(iface->cfg->key_options, + iface->cfg->value_options, + iface->cfg->n_options, &args); } error = netdev_open(&options, &netdev); shash_destroy(&args); @@ -733,7 +711,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg) struct shash args; shash_init(&args); - iface_get_options(iface->cfg, &args); + shash_from_ovs_idl_map(iface->cfg->key_options, + iface->cfg->value_options, + iface->cfg->n_options, &args); netdev_reconfigure(iface->netdev, &args); shash_destroy(&args); } -- 2.43.0