Explicitly keep track of whether the current interface config was set by
an IPMI network override, and avoid overwriting any saved config unless
the override was marked persistent.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
i += ipsize;
}
+ ifconf->override = true;
pb_log("Applying IPMI network interface override\n");
/* Replace any existing interface config */
unsigned int i;
char *val;
+ /*
+ * Don't store IPMI overrides to NVRAM. If this was a persistent
+ * override it was already stored in NVRAM by
+ * get_ipmi_network_override()
+ */
+ if (config->network.n_interfaces &&
+ config->network.interfaces[0]->override)
+ return;
+
val = talloc_strdup(platform, "");
for (i = 0; i < config->network.n_interfaces; i++) {
talloc_strdup(dest, src->static_config.url);
break;
}
+ dest->override = src->override;
return dest;
}
len += 4 + optional_strlen(conf->static_config.url);
}
+ len += 4 /* conf->override */;
+
return len;
}
conf->static_config.url);
}
+ *(uint32_t *)pos = conf->override;
+ pos += 4;
+
return pos - buf;
}
return -1;
}
+ if (read_u32(buf, len, &tmp))
+ return -1;
+ iface->override = !!tmp;
+
return 0;
}
char *url;
} static_config;
};
+ bool override;
};
struct network_config {