tcpdump mailing list archives

Re: beta1


From: Guy Harris <guy () alum mit edu>
Date: Tue, 18 Nov 2003 17:36:47 -0800


On Nov 16, 2003, at 4:59 PM, Neil Spring wrote:

I've attached a patch against current cvs that adds _U_ to unused function parameters. The only warnings that remain on my system are of signed / unsigned comparisons and no-op statements on a big-endian machine. I don't know if it's better to apply this patch or to remove the unused parameters of functions that are not called indirectly via function pointers.

In the case of "dhcp6_print()", the right thing to do, as far as I know, is to get rid of the port number arguments - if it matters whether it's being called on the server or client port, that should be passed as a Boolean flag. I've checked in that change; in a quick look at RFC 3315, I didn't see any reason why we needed to know what port the packet was going to or from.

In the case of "udp6_cksum()" and "tcp6_cksum()", the value passed to it as "len" should be the length of the UDP or TCP packet (I've cleaned up the code in "print-ip6.c" to make sure it is), so it doesn't need to recompute that length itself. I.e., that argument is now used in the code I checked in.

I also changed the IPv4 and IPv6 printers to set "snaplen" to the minimum of its current value and a pointer to the end of the IPv4/IPv6 packet's payload, so that printers called by them don't run into any trailer or FCS data.

In the case of "icmp6_rrenum_print()", the "icmp6len" argument isn't needed because of the previous change, so I got rid of it.

In the case of "vjc_print()", I'm not sure what it's supposed to do with the "proto" argument, so I left it there, without a _U_, so that we'll get warnings reminding us that we should do something about it; I also put in a comment explaining why I'm not sure what it's supposed to do.

In the case of "Parse_fh()", it arguably *should* use "len", rather than blithely fetching data from the file handle - if the length is too short for a given type of file handle, or perhaps even if it's too *long* for that type of file handle, it shouldn't check for that type of file handle. Therefore, I've again left the argument there, without a _U_, as a reminder that we should clean that up at some point.

These changes are in the main and 3.8 branches.

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: