summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3388e51)
The "targets" column in IPFIX had a min=1 constraints, so OVSDB
implicitly adds an empty string "" into that column if no value is
given. No connection can be opened to a target with address "", so
the whole IPFIX exporter for that row was disabled until that ""
target was removed by users. That behavior is correct but proved to
be unintuitive to users.
This patch removes the min=1 constraint, to avoid the trouble for
users who insert IPFIX rows with no targets: it eliminates the log
messages due to failed connections to target "", and eliminates the
need to manually remove the "" target after row insertion.
This doesn't impact the behavior for any existing row, whether it has
a "" target or not.
Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
sset_destroy(&oso.targets);
}
sset_destroy(&oso.targets);
}
+/* Returns whether a IPFIX row is valid. */
+static bool
+ovsrec_ipfix_is_valid(const struct ovsrec_ipfix *ipfix)
+{
+ return ipfix && ipfix->n_targets > 0;
+}
+
/* Returns whether a Flow_Sample_Collector_Set row is valid. */
static bool
ovsrec_fscs_is_valid(const struct ovsrec_flow_sample_collector_set *fscs,
const struct bridge *br)
{
/* Returns whether a Flow_Sample_Collector_Set row is valid. */
static bool
ovsrec_fscs_is_valid(const struct ovsrec_flow_sample_collector_set *fscs,
const struct bridge *br)
{
- return fscs->ipfix && fscs->bridge == br->cfg;
+ return ovsrec_ipfix_is_valid(fscs->ipfix) && fscs->bridge == br->cfg;
}
/* Set IPFIX configuration on 'br'. */
}
/* Set IPFIX configuration on 'br'. */
bridge_configure_ipfix(struct bridge *br)
{
const struct ovsrec_ipfix *be_cfg = br->cfg->ipfix;
bridge_configure_ipfix(struct bridge *br)
{
const struct ovsrec_ipfix *be_cfg = br->cfg->ipfix;
+ bool valid_be_cfg = ovsrec_ipfix_is_valid(be_cfg);
const struct ovsrec_flow_sample_collector_set *fe_cfg;
struct ofproto_ipfix_bridge_exporter_options be_opts;
struct ofproto_ipfix_flow_exporter_options *fe_opts = NULL;
const struct ovsrec_flow_sample_collector_set *fe_cfg;
struct ofproto_ipfix_bridge_exporter_options be_opts;
struct ofproto_ipfix_flow_exporter_options *fe_opts = NULL;
- if (!be_cfg && n_fe_opts == 0) {
+ if (!valid_be_cfg && n_fe_opts == 0) {
ofproto_set_ipfix(br->ofproto, NULL, NULL, 0);
return;
}
ofproto_set_ipfix(br->ofproto, NULL, NULL, 0);
return;
}
memset(&be_opts, 0, sizeof be_opts);
sset_init(&be_opts.targets);
memset(&be_opts, 0, sizeof be_opts);
sset_init(&be_opts.targets);
- ofproto_set_ipfix(br->ofproto, be_cfg ? &be_opts : NULL, fe_opts,
+ ofproto_set_ipfix(br->ofproto, valid_be_cfg ? &be_opts : NULL, fe_opts,
sset_destroy(&be_opts.targets);
}
sset_destroy(&be_opts.targets);
}
{"name": "Open_vSwitch",
"version": "7.3.0",
{"name": "Open_vSwitch",
"version": "7.3.0",
- "cksum": "2811681289 20311",
+ "cksum": "2495231516 20311",
"tables": {
"Open_vSwitch": {
"columns": {
"tables": {
"Open_vSwitch": {
"columns": {
"IPFIX": {
"columns": {
"targets": {
"IPFIX": {
"columns": {
"targets": {
- "type": {"key": "string", "min": 1, "max": "unlimited"}},
+ "type": {"key": "string", "min": 0, "max": "unlimited"}},
"sampling": {
"type": {"key": {"type": "integer",
"minInteger": 1,
"sampling": {
"type": {"key": {"type": "integer",
"minInteger": 1,