Skip to content

Commit fafab22

Browse files
committed
dpdk: squelch narrowing warnings.
Explicitly narrow 64-bit statistics to 32 bits, as that's all we can return in pcap_stats(). See issue #1543.
1 parent bc34ac5 commit fafab22

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pcap-dpdk.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,9 @@ static int pcap_dpdk_stats(pcap_t *p, struct pcap_stat *ps)
473473
calculate_timestamp(&(pd->ts_helper), &(pd->curr_ts));
474474
rte_eth_stats_get(pd->portid,&(pd->curr_stats));
475475
if (ps){
476-
ps->ps_recv = pd->curr_stats.ipackets;
477-
ps->ps_drop = pd->curr_stats.ierrors;
478-
ps->ps_drop += pd->bpf_drop;
479-
ps->ps_ifdrop = pd->curr_stats.imissed;
476+
ps->ps_recv = (u_int)pd->curr_stats.ipackets;
477+
ps->ps_drop = (u_int)(pd->curr_stats.ierrors + pd->bpf_drop);
478+
ps->ps_ifdrop = (u_int)pd->curr_stats.imissed;
480479
}
481480
uint64_t delta_pkt = pd->curr_stats.ipackets - pd->prev_stats.ipackets;
482481
struct timeval delta_tm;

0 commit comments

Comments
 (0)