Skip to content

Commit

Permalink
ovn-nbctl: fix sigsegv when nexthop arg is missing
Browse files Browse the repository at this point in the history
running the following command will result core dump

$ ovn-nbctl lr-policy-add lr0 2000 ip4.src==192.168.0.15 reroute
Segmentation fault (core dumped)

This commit add the missing return when the nexthop is missing

with the fix running the same comand will result the currect output
$ ovn-nbctl lr-policy-add lr0 2000 ip4.src==192.168.0.15 reroute
ovn-nbctl: Nexthop is required when action is reroute.

Signed-off-by: Moshe Levi <moshele@nvidia.com>
Signed-off-by: Numan Siddique <numans@ovn.org>

(cherry-picked from master commit 5cdfece)
  • Loading branch information
moshe010 authored and numansiddique committed Jan 4, 2021
1 parent 61b02e9 commit dfaac33
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utilities/ovn-nbctl.c
Expand Up @@ -3622,6 +3622,7 @@ nbctl_lr_policy_add(struct ctl_context *ctx)
if (!strcmp(action, "reroute")) {
if (ctx->argc < 6) {
ctl_error(ctx, "Nexthop is required when action is reroute.");
return;
}
}

Expand Down

0 comments on commit dfaac33

Please sign in to comment.