[comp.bugs.4bsd] "netstat -s" switches "size smaller than min" and "size < length"

guy@auspex.auspex.com (Guy Harris) (05/04/89)

Index: ucb 4.3BSD-tahoe

Description:
	"netstat -s" prints "ipstat.ips_tooshort", which is the count of
	packets dropped because the data in the packet was less than the
	size given in the IP header, with the description "...with size
	smaller than minimum", and prints "ipstat.ips_toosmall", which
	is the count of packets dropped because they were smaller than
	the IP header size, with the description "...with data size <
	data length".  The descriptions are reversed.
Repeat-By:
	Try using "netstat" to figure out why packets are being dropped,
	note that the reason given doesn't make any sense, and then
	verify that it doesn't make any sense by using a Sniffer to peek
	inside the packets.   Or just check out "ucb/netstat/inet.c" and
	"sys/netinet/ip_input.c" ....
Fix:
	Modify "ucb/netstat/inet.c" as follows:

*** inet.c.orig	Wed May  3 13:38:55 1989
--- inet.c	Wed May  3 13:41:43 1989
***************
*** 243,250 ****
  		ipstat.ips_total);
  	printf("\t%u bad header checksum%s\n",
  		ipstat.ips_badsum, plural(ipstat.ips_badsum));
! 	printf("\t%u with size smaller than minimum\n", ipstat.ips_tooshort);
! 	printf("\t%u with data size < data length\n", ipstat.ips_toosmall);
  	printf("\t%u with header length < data size\n", ipstat.ips_badhlen);
  	printf("\t%u with data length < header length\n", ipstat.ips_badlen);
  	printf("\t%u fragment%s received\n",
--- 243,250 ----
  		ipstat.ips_total);
  	printf("\t%u bad header checksum%s\n",
  		ipstat.ips_badsum, plural(ipstat.ips_badsum));
! 	printf("\t%u with size smaller than minimum\n", ipstat.ips_toosmall);
! 	printf("\t%u with data size < data length\n", ipstat.ips_tooshort);
  	printf("\t%u with header length < data size\n", ipstat.ips_badhlen);
  	printf("\t%u with data length < header length\n", ipstat.ips_badlen);
  	printf("\t%u fragment%s received\n",