From Neil T. Spring: fixes for many of those warnings:
addrtoname.c, configure.in: Linux needs netinet/ether.h for
ether_ntohost
print-*.c: change char *foo = "bar" to const char *foo = "bar"
to appease -Wwrite-strings; should affect no run-time behavior.
print-*.c: make some variables unsigned.
print-bgp.c: plen ('prefix len') is unsigned, no reason to
validate by comparing to zero.
print-cnfp.c, print-rx.c: use intoa, provided by addrtoname,
instead of inet_ntoa.
print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to
be false, so check for (u_int)-1, which represents failure,
explicitly.
print-isakmp.c: complete initialization of attrmap objects.
print-lwres.c: "if(x); print foo;" seemed much more likely to be
intended to be "if(x) { print foo; }".
print-smb.c: complete initialization of some structures.
In addition, add some fixes for the signed vs. unsigned comparison
warnings:
extract.h: cast the result of the byte-extraction-and-combining,
as, at least for the 16-bit version, C's integral promotions
will turn "u_int16_t" into "int" if there are other "int"s
nearby.
print-*.c: make some more variables unsigned, or add casts to an
unsigned type of signed values known not to be negative, or add
casts to "int" of unsigned values known to fit in an "int", and
make other changes needed to handle the aforementioned variables
now being unsigned.
print-isakmp.c: clean up the handling of error/status indicators
in notify messages.
print-ppp.c: get rid of a check that an unsigned quantity is >=
0.
print-radius.c: clean up some of the bounds checking.
print-smb.c: extract the word count into a "u_int" to avoid the
aforementioned problems with C's integral promotions.
print-snmp.c: change a check that an unsigned variable is >= 0
to a check that it's != 0.
Also, fix some formats to use "%u" rather than "%d" for unsigned
quantities.
parsefattr misuses nfsv2 version members for v3.
print_int64 prints at least 9 digits unnecessarily.
-u flag doesn't always suppress decoding handles.
from Takashi Yamamoto <yamt@mwd.biglobe.ne.jp>.
the request header and the file handle.
"parsestatus()" should only return NULL if the packet was truncated, so
that its callers can distinguish "packet truncated" from "NFS reply
status reports an error".
NFS-request-or-reply parsing routines that call "parsestatus()" should
not return 0 if "parsestatus()" returns a non-zero NFS reply status, so
that non-truncated packets with a non-zero NFS reply status aren't
printed as truncated NFS packets.
Fix some "TCHECK2()" calls to pass an object, not a pointer to an
object, as the first argument (the TCHECK/TTEST macros take objects, not
addresses, as the test argument).
NFS-request-or-reply parsing routines should return 0 for truncated
packets and 1 for non-truncated packets, not *vice versa*.
ip6.h is almost normal RFC2292 header.
icmp6.h has couple of extensions (not covered by RFC2292),
like MLD, ICMPv6 nodeinfo, and router renumber.
XXX how to synchronize with future kame changes?
have dissectors include them rather than <netinet/ip.h> or
<netinet/ip_var.h>, if they actually need that stuff.
Put the declarations of the ICMP stuff directly into "print-icmp.c".
Remove all unnecessary includes of <netinet/ip*.h> files.
Copy the byte-order stuff from "nameser.h" into "tcp.h".
"linux-includes/netinet/if_ether.h" to "ethertype.h".
Move other stuff used by dissectors from <netinet/if_ether.h> to
"ether.h", along the lines of "fddi.h" and "token.h".
Move ARP declarations from BSD include files to "print-arp.c".
Remove from dissectors includes of <netinet/if_ether.h>, and add
includes of "ethertype.h" and/or "ether.h" as necessary.
Get rid of configuration options that test declarations now made in
"ether.h" or "print-arp.c", as those declarations are now under our
control, not the OS's control.
rather than using "pcap_strerror()", as
1) not all NFS error statuses are UNIX errno values;
2) even those that are UNIX errno values aren't necessarily
errno values for the system on which you're running tcpdump.
Get rid of T2CHECK() in favor of TCHECK() or TCHECK2().
Use TCHECK() etc. instead of comparing vs. snapend.
Replace strerr() with pcap_strerror(), and don't use errno as a local variable.
Use tok2str() for nfsv3_writemodes to avoid array overrun by corrupt packets.