Skip to content

Commit

Permalink
ovn-trace: fix trigger_event warning.
Browse files Browse the repository at this point in the history
Fix the following ovn-trace warning triggered by controller_event:

00001|ovntrace|WARN|trigger_event(event = "empty_lb_backends", meter = "",
				  vip = "192.168.0.100:80", protocol = "tcp",
				  load_balancer = "2c5462a7-b6ca-4b02-86c9-b9aa98a570e8");
parsing actions failed (Syntax error a t `vip' expecting empty_lb_backends option name.)

The issue can be triggered running the following reproducer in ovn-sanbox:

$./ovn-setup.sh
$ovn-nbctl lb-add lb0 192.168.0.100:80 ""
$ovn-nbctl ls-lb-add sw0 lb0
$ovn-nbctl --wait=hv set NB_Global . options:controller_event=true
$ovn-trace sw0 'inport == "sw0-port1" && eth.src == 50:54:00:00:00:01 && ip4.src==192.168.0.2 && eth.dst == 00:00:00:00:ff:01 && ip4.dst==192.168.0.100 && tcp && tcp.dst==80'

Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>

(cherry-picked from master commit f35e332)
  • Loading branch information
LorenzoBianconi authored and numansiddique committed Jan 8, 2021
1 parent dd9188d commit 847589a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/ovn.at
Expand Up @@ -15481,6 +15481,8 @@ AT_CHECK([ovn-sbctl get controller_event $uuid event_info:vip], [0], [dnl
"192.168.2.100:80"
])

AT_CHECK_UNQUOTED([ovn-trace sw0 'inport == "sw0-p11" && eth.src == 00:00:00:00:00:11 && ip4.dst == 192.168.1.100 && tcp && tcp.dst == 80' | grep -q 'event = "empty_lb_backends"'], [0])

OVN_CLEANUP([hv1], [hv2])
AT_CLEANUP

Expand Down
4 changes: 4 additions & 0 deletions utilities/ovn-trace.c
Expand Up @@ -476,6 +476,7 @@ static struct shash port_groups;
static struct hmap dhcp_opts; /* Contains "struct gen_opts_map"s. */
static struct hmap dhcpv6_opts; /* Contains "struct gen_opts_map"s. */
static struct hmap nd_ra_opts; /* Contains "struct gen_opts_map"s. */
static struct controller_event_options event_opts;

static struct ovntrace_datapath *
ovntrace_datapath_find_by_sb_uuid(const struct uuid *sb_uuid)
Expand Down Expand Up @@ -902,6 +903,7 @@ read_flows(void)
.dhcp_opts = &dhcp_opts,
.dhcpv6_opts = &dhcpv6_opts,
.nd_ra_opts = &nd_ra_opts,
.controller_event_opts = &event_opts,
.pipeline = (!strcmp(sblf->pipeline, "ingress")
? OVNACT_P_INGRESS
: OVNACT_P_EGRESS),
Expand Down Expand Up @@ -981,6 +983,8 @@ read_gen_opts(void)

hmap_init(&nd_ra_opts);
nd_ra_opts_init(&nd_ra_opts);

controller_event_opts_init(&event_opts);
}

static void
Expand Down

0 comments on commit 847589a

Please sign in to comment.