tcpdump mailing list archives
Re: tcpdump build problems in latest CVS
From: Guy Harris <guy () alum mit edu>
Date: Sat, 25 Jan 2003 18:28:58 -0800
On Fri, Jan 24, 2003 at 10:51:31PM -0600, Peter Fales wrote:
I build tcpdump for a number of different platforms and I'm seeing several problems in the latest CVS in that weren't in earlier versions:
Yes, there's a fair amount of new stuff that's been added to tcpdump since, for example, the 3.7 series.
On some platforms (namely SunOS 4), sprintf doesn't return the number
of bytes written, so this doesn't work. I usually change this to:
sprint(p, ...)
p += strlen(p);
I've checked a change like that in.
- On platforms which don't have snprintf, the configure checks for pcap_datalink_name_to_val and pcap_list_datalinks incorrectly report "not found". The conftest.c assumes that a link failure is because this function is missing, but it is actually failing because snprintf is not found. (The references to snprintf are coming from libpcap, so perhaps this is a libpcap issue - has it just started calling snprintf/vsnprint?)
Not recently - that's been the case for a couple of releases now, I
think. The problem is that "pcap_datalink_name_to_val()" and
"pcap_list_datalinks()" are new, so the configure checks for them are
new.
I think we've seen other problems on platforms without snprintf - for
example, libpcap doesn't have its own snprintf that it includes if the
system doesn't supply it, so, on platforms without snprintf,
applications must supply their own "snprintf()" if they're to be linked
with libpcap.
We should perhaps take tcpdump's implementation, transplant it to
libpcap and perhaps give it the names "pcap_snprintf()" and
"pcap_vsnprintf()", have have the libpcap configure script check whether
snprintf is available on the system and:
if so, #define "pcap_snprintf" as "snprintf" and
"pcap_vsnprintf" as "vsnprintf" in some header file;
if not, declare "pcap_snprintf()" and "pcap_vsnprintf()" in that
header file.
If we were more ambitious, we could, instead, have libpcap *always*
define "pcap_snprintf()" and "pcap_vsnprintf()", and have them both be
wrappers that call "vsnprintf()" on systems that have it, and declare
them in "pcap.h". However, tcpdump would still have to carry its own
version around, in case you build the latest tcpdump with the
vendor-supplied libpcap on a system lacking snprintf.
- On Irix 6.2, /usr/include/sys/socket.h has a #define for sa_len. This breaks print-arp.c around line 162 which has its own sa_len variable.
I've renamed the variable. - 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:
- New DLT_ value for Linux/Arcnet? Peter Fales (Jan 20)
- Re: New DLT_ value for Linux/Arcnet? Guy Harris (Jan 20)
- tcpdump build problems in latest CVS Peter Fales (Jan 24)
- Re: tcpdump build problems in latest CVS Guy Harris (Jan 28)
