And more 64-bit-to-32-bit time issues on 32-bit platforms.
authorGuy Harris <guy@alum.mit.edu>
Wed, 26 Dec 2012 09:56:18 +0000 (09:56 -0000)
committerGuy Harris <guy@alum.mit.edu>
Wed, 26 Dec 2012 09:56:18 +0000 (09:56 -0000)
svn path=/trunk/; revision=46763

epan/dissectors/packet-netflow.c

index 70ac1172c3ba1723693eb1b81d3310d09adb0f28..0a852d33f99a7371136b12de8b75be5ec5e01100 100644 (file)
@@ -2658,14 +2658,14 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
 
         case 152: /*  flowStartMilliseconds: 64-bit integer */
             offset_s[rev] = offset;
-            ts_start[rev].secs = tvb_get_ntoh64(tvb, offset)/1000;
+            ts_start[rev].secs = (time_t)(tvb_get_ntoh64(tvb, offset)/1000);
             ts_start[rev].nsecs = (int)(tvb_get_ntoh64(tvb, offset)%1000) * 1000000;
             goto timestamp_common;
             break;
 
         case 153: /*  flowEndMilliseconds; 64-bit integer */
             offset_e[rev] = offset;
-            ts_end[rev].secs  = (tvb_get_ntoh64(tvb, offset)/1000);
+            ts_end[rev].secs  = (time_t)(tvb_get_ntoh64(tvb, offset)/1000);
             ts_end[rev].nsecs = (int)(tvb_get_ntoh64(tvb, offset)%1000) * 1000000;
             goto timestamp_common;
             break;
@@ -2702,7 +2702,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
             /*  XXX: Not tested ...                                                */
             offset_s[rev]       = offset;
             usec                = tvb_get_ntohl(tvb, offset);
-            ts_start[rev].secs  = (((guint64)(hdrinfo_p->export_time_secs)*1000000 - usec) / 1000000);
+            ts_start[rev].secs  = (time_t)(((guint64)(hdrinfo_p->export_time_secs)*1000000 - usec) / 1000000);
             ts_start[rev].nsecs = (int)(((guint64)(hdrinfo_p->export_time_secs)*1000000 - usec) % 1000000) * 1000;
             goto timestamp_common;
             break;
@@ -2712,7 +2712,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
             /*  XXX: Not tested ...                                                */
             offset_e[rev] = offset;
             usec          = tvb_get_ntohl(tvb, offset);
-            ts_end[rev].secs  = (((guint64)(hdrinfo_p->export_time_secs)*1000000 - usec) / 1000000);
+            ts_end[rev].secs  = (time_t)(((guint64)(hdrinfo_p->export_time_secs)*1000000 - usec) / 1000000);
             ts_end[rev].nsecs = (int)(((guint64)(hdrinfo_p->export_time_secs)*1000000 - usec) % 1000000) * 1000;
 
             /* This code executed for all timestamp fields above  */
@@ -3368,7 +3368,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
             break;
 
         case 160: /*  systemInitTimeMilliseconds */
-            ts.secs  = (tvb_get_ntoh64(tvb, offset)/1000);
+            ts.secs  = (time_t)(tvb_get_ntoh64(tvb, offset)/1000);
             ts.nsecs = (int)(tvb_get_ntoh64(tvb, offset)%1000) *1000000;
             ti = proto_tree_add_time(pdutree,
                                      hf_cflow_sys_init_time,
@@ -3947,7 +3947,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
             break;
 
         case 258: /* collectionTimeMilliseconds */
-            ts.secs  = (tvb_get_ntoh64(tvb, offset)/1000);
+            ts.secs  = (time_t)(tvb_get_ntoh64(tvb, offset)/1000);
             ts.nsecs = (int)(tvb_get_ntoh64(tvb, offset)%1000) *1000000;
             ti = proto_tree_add_time(pdutree,
                                      hf_cflow_collection_time_milliseconds,
@@ -4013,7 +4013,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
             break;
 
         case 269: /* maxFlowEndMilliseconds */
-            ts.secs =  (tvb_get_ntoh64(tvb, offset)/1000);
+            ts.secs =  (time_t)(tvb_get_ntoh64(tvb, offset)/1000);
             ts.nsecs = (int)(tvb_get_ntoh64(tvb, offset)%1000) * 1000000;
             ti = proto_tree_add_time(pdutree, hf_cflow_max_flow_end_milliseconds,
                                      tvb, offset, length, &ts);
@@ -4154,7 +4154,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
             break;
 
         case 323: /* observationTimeMilliseconds */
-            ts.secs  = (tvb_get_ntoh64(tvb, offset)/1000);
+            ts.secs  = (time_t)(tvb_get_ntoh64(tvb, offset)/1000);
             ts.nsecs = (int)(tvb_get_ntoh64(tvb, offset)%1000) * 1000000;
             ti = proto_tree_add_time(pdutree, hf_cflow_observation_time_milliseconds,
                                      tvb, offset, length, &ts);