summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBenli Ye <daniely@vmware.com>2016-06-14 11:09:45 +0800
committerBen Pfaff <blp@ovn.org>2016-06-14 08:27:54 -0700
commitd1b97f99a7f350420439e44c0fa78e8da1757a63 (patch)
tree768a2d846d52b1b34722aad220b8a1cb25b3fe27 /ofproto
parentfb8f22c186b89cd36059c37908f940a1aa5e1569 (diff)
downloadopenvswitch-d1b97f99a7f350420439e44c0fa78e8da1757a63.tar.gz
ipfix: Bug fix for not sending template packets on 32-bit OS
'last_template_set_time' in truct dpif_ipfix_exporter is declared as time_t and time_t is long int type. If we initialize 'last_template_set_time' as TIME_MIN, whose value is -2147483648 on 32-bit OS and -2^63 on 64-bit OS. There will be a problem on 32-bit OS when comparing 'last_template_set_time' with a unisgned int type variable, because type casting will happen and negative value could be a large positive number. Fix this problem by simply initialize 'last_template_set_time' as 0. Signed-off-by: Benli Ye <daniely@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-ipfix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c
index d80ff2d8e..b692026ad 100644
--- a/ofproto/ofproto-dpif-ipfix.c
+++ b/ofproto/ofproto-dpif-ipfix.c
@@ -507,7 +507,7 @@ dpif_ipfix_exporter_init(struct dpif_ipfix_exporter *exporter)
{
exporter->collectors = NULL;
exporter->seq_number = 1;
- exporter->last_template_set_time = TIME_MIN;
+ exporter->last_template_set_time = 0;
hmap_init(&exporter->cache_flow_key_map);
ovs_list_init(&exporter->cache_flow_start_timestamp_list);
exporter->cache_active_timeout = 0;
@@ -523,7 +523,7 @@ dpif_ipfix_exporter_clear(struct dpif_ipfix_exporter *exporter)
collectors_destroy(exporter->collectors);
exporter->collectors = NULL;
exporter->seq_number = 1;
- exporter->last_template_set_time = TIME_MIN;
+ exporter->last_template_set_time = 0;
exporter->cache_active_timeout = 0;
exporter->cache_max_flows = 0;
}