ip: fix format string when reading statistics
The tunnel code was doing sscanf(buf, "%ld", &x) where x was unsigned long.
This commit is contained in:
parent
b08b5ff128
commit
654ae881de
|
|
@ -354,7 +354,7 @@ static int do_tunnels_list(struct ip6_tnl_parm2 *p)
|
|||
fprintf(stderr, "Wrong format for /proc/net/dev. Giving up.\n");
|
||||
goto end;
|
||||
}
|
||||
if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
|
||||
if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
|
||||
&rx_bytes, &rx_packets, &rx_errs, &rx_drops,
|
||||
&rx_fifo, &rx_frame, &rx_multi,
|
||||
&tx_bytes, &tx_packets, &tx_errs, &tx_drops,
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
|
|||
fprintf(stderr, "Wrong format for /proc/net/dev. Giving up.\n");
|
||||
goto end;
|
||||
}
|
||||
if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
|
||||
if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
|
||||
&rx_bytes, &rx_packets, &rx_errs, &rx_drops,
|
||||
&rx_fifo, &rx_frame, &rx_multi,
|
||||
&tx_bytes, &tx_packets, &tx_errs, &tx_drops,
|
||||
|
|
|
|||
Loading…
Reference in New Issue