tcpdump mailing list archives
patch for fad-getad.c and configure.in
From: Darren Reed <Darren.Reed () Sun COM>
Date: Sat, 08 May 2010 22:25:36 -0700
This patch changes the #ifdef for knowing about the path to "if_packet.h" to being the result of work done by configure. Rerunning autoconf to regenerate configure from configure.in is required after applying this patch. There might be some appropriate use of #else here as it seems that glibc ships with <netpacket/packet.h>. For example, if <netpacket/packet.h> is present, is it also necessary to use <linux/if_packet.h> or <netpacket/if_packet.h>? The only properly documented location for this file that I can find is that various man pages refer to <netpacket/packet.h> - and this is what is now found in OpenSolaris. I suspect that checking for that alone is not enough but I don't have any Linux boxes present to test with :/ That aside, the change has merit if only because it replaces the use of implied file presence through some other symbol with the actual detection of the files being present using configure. Summary of this patch: "yay linux!" Darren --- fad-getad.c.dist Mon Apr 5 10:54:05 2010 +++ fad-getad.c Sat May 8 22:11:18 2010 @@ -61,15 +61,19 @@ #endif #ifdef AF_PACKET -# ifdef __Lynx__ -/* LynxOS */ +#ifdef HAVE_NETPACKET_IF_PACKET_H # include <netpacket/if_packet.h> -# else -/* Linux */ +#endif +#ifdef HAVE_NETPACKET_PACKET_H +# include <netpacket/packet.h> +#endif +#ifdef HAVE_LINUX_TYPES_H # include <linux/types.h> +#endif +#ifdef HAVE_LINUX_IF_PACKET_H # include <linux/if_packet.h> -# endif #endif +#endif /* * This is fun. --- configure.in.dist Sat May 8 22:08:18 2010 +++ configure.in Sat May 8 22:11:29 2010 @@ -29,6 +29,7 @@ AC_C___ATTRIBUTE__ AC_CHECK_HEADERS(sys/bitypes.h)+AC_CHECK_HEADERS(linux/types.h linux/if_packet.h netpacket/if_packet.h netpacket/packet.h)
AC_CHECK_TYPE([int8_t], , [AC_DEFINE([int8_t], [signed char], - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- patch for fad-getad.c and configure.in Darren Reed (May 08)