X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=d505b533c9ecc8e774962740454fa61c7758dfcc;hb=bc22fc3e661915586e96efdb2241101d97b7946a;hp=f739505e3ec06c3b2be31e560511805754f10f53;hpb=ee45ad81ab7e9ff6034352b6743985e28fedd649;p=openvswitch diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index f739505e..d505b533 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); } @@ -1121,6 +1101,14 @@ dpid_from_hash(const void *data, size_t n) return eth_addr_to_uint64(hash); } +static void +iface_refresh_tunnel_egress(struct iface *iface) +{ + const char *name = netdev_get_tnl_iface(iface->netdev); + + ovsrec_interface_set_tunnel_egress_iface(iface->cfg, name); +} + static void iface_refresh_cfm_stats(struct iface *iface) { @@ -1330,6 +1318,7 @@ bridge_run(void) struct iface *iface = port->ifaces[j]; iface_refresh_stats(iface); iface_refresh_cfm_stats(iface); + iface_refresh_tunnel_egress(iface); } } }