[ovs-dev,ovn,01/19] ovn-northd.c: Fix datapath tunnel key allocation.
diff mbox series

Message ID 1571619079-75503-2-git-send-email-hzhou@ovn.org
State New
Headers show
Series
  • OVN Interconnection
Related show

Commit Message

Han Zhou Oct. 21, 2019, 12:51 a.m. UTC
The max tunnel key for datapath is defined as (1u << 24) - 1, but
we are using uint16_t variable to hold the value, which will result
in duplicated key when there are enough number of datapath key
allocation and deletions.

Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 northd/ovn-northd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index ea8ad7c..18f6e76 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -1049,7 +1049,7 @@  build_datapaths(struct northd_context *ctx, struct hmap *datapaths,
 
         /* Add southbound record for each unmatched northbound record. */
         LIST_FOR_EACH (od, list, &nb_only) {
-            uint16_t tunnel_key = ovn_datapath_allocate_key(&dp_tnlids);
+            uint32_t tunnel_key = ovn_datapath_allocate_key(&dp_tnlids);
             if (!tunnel_key) {
                 break;
             }