From 9cb2f23877fec13693f27986e4d075152f318d0f Mon Sep 17 00:00:00 2001
From: Dumitru Ceara <dceara@redhat.com>
Date: Fri, 28 Aug 2020 14:10:54 +0200
Subject: [PATCH] ovn-nbctl: Deal with nb_cfg overflows.
Reported-at: https://bugzilla.redhat.com/id=1873455
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry-picked from master commit be3a60f8e6a3a01e08ae6fe760279dc4f274562a)
(cherry picked from upstream commit 49f322806785cf1195dfa8cfb63531cd1c119e5b)
Change-Id: Iba7df83c1d8b88a70fff3c69b985ef46db8d18c4
---
utilities/ovn-nbctl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index e6d8dbe..bd66ee6 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -6080,6 +6080,11 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands,
nb = nbrec_nb_global_insert(txn);
}
+ /* Deal with potential overflows. */
+ if (nb->nb_cfg == LLONG_MAX) {
+ nbrec_nb_global_set_nb_cfg(nb, 0);
+ }
+
if (wait_type != NBCTL_WAIT_NONE) {
ovsdb_idl_txn_increment(txn, &nb->header_, &nbrec_nb_global_col_nb_cfg,
force_wait);
--
1.8.3.1