]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fix signature of pcap_stats_ex_remote().
authorGuy Harris <[email protected]>
Fri, 29 Jul 2016 04:36:00 +0000 (21:36 -0700)
committerGuy Harris <[email protected]>
Fri, 29 Jul 2016 04:36:00 +0000 (21:36 -0700)
A stats_ex_op function takes two arguments, the second of which points
to a variable that should be set to the size of the stat structure.

Fix a comment while we're at it.

pcap-remote.c

index 448e4a08c458b1c0f89e5ce3187dc152579dca68..3a1fe2ef0f6976a958532223649de84eba30597e 100644 (file)
@@ -517,9 +517,11 @@ static int pcap_stats_remote(pcap_t *p, struct pcap_stat *ps)
  *
  * Parameters and return values are exactly the same of the pcap_stats_ex().
  */
-static struct pcap_stat *pcap_stats_ex_remote(pcap_t *p)
+static struct pcap_stat *pcap_stats_ex_remote(pcap_t *p, int *pcap_stat_size)
 {
-       /* '0' (third param) means 'standard pcap_stats()' */
+       *pcap_stat_size = sizeof (p->stat);
+
+       /* PCAP_STATS_EX (third param) means 'extended pcap_stats()' */
        return (rpcap_stats_remote(p, &(p->stat), PCAP_STATS_EX));
 }
 #endif