summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorYunjian Wang <wangyunjian@huawei.com>2021-04-27 14:41:46 +0800
committerBen Pfaff <blp@ovn.org>2021-07-02 13:43:26 -0700
commit780b2bde80c86526daf9f93e33687b5a9b23f737 (patch)
tree2aed8edd5bcb0793ac42edb91d35cfc5790b8f28 /vswitchd
parent911adb93ee8e1c7a8956a69f11e589cf1312f5ee (diff)
downloadopenvswitch-780b2bde80c86526daf9f93e33687b5a9b23f737.tar.gz
bridge: fix type mismatch
Currently the function ofproto_set_flow_limit() was not checking 'limit' value. It maybe negative, which will be lead to a big unsigned value. The 'limit' should never be negative so it's better to just use smap_get_uint() to get it right. And fix ofproto_set_max_idle(), ofproto_set_min_revalidate_pps(), ofproto_set_max_revalidator() and ofproto_set_bundle_idle_timeout() together. Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 7f3bdc294..0432d2abf 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -822,19 +822,19 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
COVERAGE_INC(bridge_reconfigure);
- ofproto_set_flow_limit(smap_get_int(&ovs_cfg->other_config, "flow-limit",
+ ofproto_set_flow_limit(smap_get_uint(&ovs_cfg->other_config, "flow-limit",
OFPROTO_FLOW_LIMIT_DEFAULT));
- ofproto_set_max_idle(smap_get_int(&ovs_cfg->other_config, "max-idle",
+ ofproto_set_max_idle(smap_get_uint(&ovs_cfg->other_config, "max-idle",
OFPROTO_MAX_IDLE_DEFAULT));
- ofproto_set_max_revalidator(smap_get_int(&ovs_cfg->other_config,
+ ofproto_set_max_revalidator(smap_get_uint(&ovs_cfg->other_config,
"max-revalidator",
OFPROTO_MAX_REVALIDATOR_DEFAULT));
ofproto_set_min_revalidate_pps(
- smap_get_int(&ovs_cfg->other_config, "min-revalidate-pps",
+ smap_get_uint(&ovs_cfg->other_config, "min-revalidate-pps",
OFPROTO_MIN_REVALIDATE_PPS_DEFAULT));
ofproto_set_vlan_limit(smap_get_int(&ovs_cfg->other_config, "vlan-limit",
LEGACY_MAX_VLAN_HEADERS));
- ofproto_set_bundle_idle_timeout(smap_get_int(&ovs_cfg->other_config,
+ ofproto_set_bundle_idle_timeout(smap_get_uint(&ovs_cfg->other_config,
"bundle-idle-timeout", 0));
ofproto_set_threads(
smap_get_int(&ovs_cfg->other_config, "n-handler-threads", 0),