From: Moshe Levi <[email protected]>

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 <[email protected]>
---
 utilities/ovn-nbctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 94e7eedeb..d67f5c456 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3648,6 +3648,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;
         }
         reroute = true;
     }
-- 
2.30.0.windows.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to