/* Collect new bridges' names and types. */
shash_init(&new_br);
for (i = 0; i < cfg->n_bridges; i++) {
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
const struct ovsrec_bridge *br_cfg = cfg->bridges[i];
- if (!shash_add_once(&new_br, br_cfg->name, br_cfg)) {
- VLOG_WARN("bridge %s specified twice", br_cfg->name);
+
+ if (strchr(br_cfg->name, '/')) {
+ /* Prevent remote ovsdb-server users from accessing arbitrary
+ * directories, e.g. consider a bridge named "../../../etc/". */
+ VLOG_WARN_RL(&rl, "ignoring bridge with invalid name \"%s\"",
+ br_cfg->name);
+ } else if (!shash_add_once(&new_br, br_cfg->name, br_cfg)) {
+ VLOG_WARN_RL(&rl, "bridge %s specified twice", br_cfg->name);
}
}
}
}
-/* Writes 'iface''s CFM statistics to the database. Returns true if anything
- * changed, false otherwise. */
+/* Writes 'iface''s CFM statistics to the database. */
static void
iface_refresh_cfm_stats(struct iface *iface)
{
iface_configure_cfm(struct iface *iface)
{
const struct ovsrec_interface *cfg = iface->cfg;
- const char *extended_str;
+ const char *extended_str, *opstate_str;
struct cfm_settings s;
if (!cfg->n_cfm_mpid) {
"false");
s.extended = !strcasecmp("true", extended_str);
+ opstate_str = get_interface_other_config(iface->cfg, "cfm_opstate", "up");
+ s.opup = !strcasecmp("up", opstate_str);
+
ofproto_port_set_cfm(iface->port->bridge->ofproto, iface->ofp_port, &s);
}