summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-03-19 03:33:32 +0000
committerglebius <glebius@FreeBSD.org>2014-03-19 03:33:32 +0000
commit1bb14616e9ab64d01f1ab514361a82e686a0e293 (patch)
treeebb70ac3a85a7eddd8a47336d579306c4b954f56 /usr.bin/netstat
parentb41aca8e4d1667242ba798bec20b2f33c06e1a72 (diff)
downloadFreeBSD-src-1bb14616e9ab64d01f1ab514361a82e686a0e293.zip
FreeBSD-src-1bb14616e9ab64d01f1ab514361a82e686a0e293.tar.gz
Now, after r263102 we have ifi_oqdrops in if_data, restore printing of
output queue drops in netstat(1). No driver, neither kernel fills this field in if_data, yet. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/if.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index ce2db16..a4c86be 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -249,7 +249,7 @@ intpr(int interval, void (*pfunc)(char *), int af)
printf(" %10.10s","Obytes");
printf(" %5s", "Coll");
if (dflag)
- printf(" %s", "Drop");
+ printf(" %s", "Drop");
putchar('\n');
}
@@ -358,7 +358,8 @@ intpr(int interval, void (*pfunc)(char *), int af)
if (bflag)
show_stat("lu", 10, IFA_STAT(obytes), link|network);
show_stat("NRSlu", 5, IFA_STAT(collisions), link);
- /* XXXGL: output queue drops */
+ if (dflag)
+ show_stat("LSlu", 5, IFA_STAT(oqdrops), link);
putchar('\n');
if (!aflag)
@@ -438,6 +439,7 @@ struct iftot {
u_long ift_id; /* input drops */
u_long ift_op; /* output packets */
u_long ift_oe; /* output errors */
+ u_long ift_od; /* output drops */
u_long ift_co; /* collisions */
u_long ift_ib; /* input bytes */
u_long ift_ob; /* output bytes */
@@ -473,6 +475,7 @@ fill_iftot(struct iftot *st)
st->ift_ib += IFA_STAT(ibytes);
st->ift_op += IFA_STAT(opackets);
st->ift_oe += IFA_STAT(oerrors);
+ st->ift_od += IFA_STAT(oqdrops);
st->ift_ob += IFA_STAT(obytes);
st->ift_co += IFA_STAT(collisions);
}
@@ -551,7 +554,8 @@ loop:
show_stat("lu", 5, new->ift_oe - old->ift_oe, 1);
show_stat("lu", 10, new->ift_ob - old->ift_ob, 1);
show_stat("NRSlu", 5, new->ift_co - old->ift_co, 1);
- /* XXXGL: output queue drops */
+ if (dflag)
+ show_stat("LSlu", 5, new->ift_od - old->ift_od, 1);
putchar('\n');
fflush(stdout);
OpenPOWER on IntegriCloud