Need to check tnlid dosen't exceed max and wrap it when it dose. Signed-off-by: Wei Li <li...@anbutu.com> --- ovn/northd/ovn-northd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 396381049..f286322b1 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -298,7 +298,7 @@ allocate_tnlid(struct hmap *set, const char *name, uint32_t max, { for (uint32_t tnlid = *hint + 1; tnlid != *hint; tnlid = tnlid + 1 <= max ? tnlid + 1 : 1) { - if (!tnlid_in_use(set, tnlid)) { + if (tnlid <= max && !tnlid_in_use(set, tnlid)) { add_tnlid(set, tnlid); *hint = tnlid; return tnlid; -- 2.16.3 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev