ipfix: Bug fix for not sending template packets on 32-bit OS
authorBenli Ye <daniely@vmware.com>
Tue, 14 Jun 2016 03:09:45 +0000 (11:09 +0800)
committerBen Pfaff <blp@ovn.org>
Tue, 14 Jun 2016 15:27:54 +0000 (08:27 -0700)
commitd1b97f99a7f350420439e44c0fa78e8da1757a63
tree768a2d846d52b1b34722aad220b8a1cb25b3fe27
parentfb8f22c186b89cd36059c37908f940a1aa5e1569
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>
ofproto/ofproto-dpif-ipfix.c