Add an ovs_assert() in  this case, as a valid meter should exists.

Signed-off-by: Eelco Chaudron <[email protected]>
---
v2: Change the solution to use ovs_assert().
---
 ofproto/ofproto.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 3df64efb9..260389865 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -6948,6 +6948,7 @@ meter_insert_rule(struct rule *rule)
     uint32_t meter_id = ofpacts_get_meter(a->ofpacts, a->ofpacts_len);
     struct meter *meter = ofproto_get_meter(rule->ofproto, meter_id);
 
+    ovs_assert(meter);
     ovs_list_insert(&meter->rules, &rule->meter_list_node);
 }
 
-- 
2.47.1

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

Reply via email to