tcpdump/tcpdump.patch

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 Index: configure.in
     2 --- configure.in.orig	2010-03-12 02:56:44.000000000 +0100
     3 +++ configure.in	2010-03-31 09:51:51.000000000 +0200
     4 @@ -739,10 +739,10 @@
     6  if test $ac_cv_func_pcap_lib_version = "no" ; then
     7      AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
     8 -    AC_TRY_LINK([],
     9 +    AC_TRY_LINK(
    10         [
    11  	extern char pcap_version[];
    12 -
    13 +       ],[
    14  	return (int)pcap_version;
    15         ],
    16         ac_lbl_cv_pcap_version_defined=yes,
    17 @@ -755,10 +755,10 @@
    18      fi
    19  fi
    20  AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
    21 -AC_TRY_LINK([],
    22 +AC_TRY_LINK(
    23     [
    24  	extern int pcap_debug;
    25 -
    26 +   ],[
    27  	return pcap_debug;
    28     ],
    29     ac_lbl_cv_pcap_debug_defined=yes,
    30 @@ -772,10 +772,10 @@
    31  	# OK, what about "yydebug"?
    32  	#
    33  	AC_MSG_CHECKING(whether yydebug is defined by libpcap)
    34 -	AC_TRY_LINK([],
    35 +	AC_TRY_LINK(
    36  	   [
    37  		extern int yydebug;
    38 -
    39 +	   ],[
    40  		return yydebug;
    41  	   ],
    42  	   ac_lbl_cv_yydebug_defined=yes,
    43 Index: ether.h
    44 --- ether.h.orig	2010-03-12 02:56:44.000000000 +0100
    45 +++ ether.h	2010-03-31 09:51:51.000000000 +0200
    46 @@ -34,7 +34,9 @@
    47   *	@(#)if_ether.h	8.3 (Berkeley) 5/2/95
    48   */
    50 +#ifndef ETHERMTU
    51  #define	ETHERMTU	1500
    52 +#endif
    54  /*
    55   * The number of bytes in an ethernet (MAC) address.
    56 @@ -44,7 +46,7 @@
    57  /*
    58   * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
    59   */
    60 -struct	ether_header {
    61 +struct	tcpdump_ether_header {
    62  	u_int8_t	ether_dhost[ETHER_ADDR_LEN];
    63  	u_int8_t	ether_shost[ETHER_ADDR_LEN];
    64  	u_int16_t	ether_type;
    65 Index: print-ether.c
    66 --- print-ether.c.orig	2010-03-12 02:56:44.000000000 +0100
    67 +++ print-ether.c	2010-03-31 09:55:05.000000000 +0200
    68 @@ -86,10 +86,10 @@
    69  static inline void
    70  ether_hdr_print(register const u_char *bp, u_int length)
    71  {
    72 -	register const struct ether_header *ep;
    73 +	register const struct tcpdump_ether_header *ep;
    74  	u_int16_t ether_type;
    76 -	ep = (const struct ether_header *)bp;
    77 +	ep = (const struct tcpdump_ether_header *)bp;
    79  	(void)printf("%s > %s",
    80  		     etheraddr_string(ESRC(ep)),
    81 @@ -123,7 +123,7 @@
    82  ether_print(const u_char *p, u_int length, u_int caplen,
    83      void (*print_encap_header)(const u_char *), const u_char *encap_header_arg)
    84  {
    85 -	struct ether_header *ep;
    86 +	struct tcpdump_ether_header *ep;
    87  	u_int orig_length;
    88  	u_short ether_type;
    89  	u_short extracted_ether_type;
    90 @@ -142,7 +142,7 @@
    92  	length -= ETHER_HDRLEN;
    93  	caplen -= ETHER_HDRLEN;
    94 -	ep = (struct ether_header *)p;
    95 +	ep = (struct tcpdump_ether_header *)p;
    96  	p += ETHER_HDRLEN;
    98  	ether_type = EXTRACT_16BITS(&ep->ether_type);
    99 Index: print-fddi.c
   100 --- print-fddi.c.orig	2010-03-12 02:56:44.000000000 +0100
   101 +++ print-fddi.c	2010-03-31 09:51:51.000000000 +0200
   102 @@ -242,7 +242,7 @@
   103  fddi_print(const u_char *p, u_int length, u_int caplen)
   104  {
   105  	const struct fddi_header *fddip = (const struct fddi_header *)p;
   106 -	struct ether_header ehdr;
   107 +	struct tcpdump_ether_header ehdr;
   108  	u_short extracted_ethertype;
   110  	if (caplen < FDDI_HDRLEN) {
   111 Index: print-ipfc.c
   112 --- print-ipfc.c.orig	2010-03-12 02:56:44.000000000 +0100
   113 +++ print-ipfc.c	2010-03-31 09:51:51.000000000 +0200
   114 @@ -81,7 +81,7 @@
   115  ipfc_print(const u_char *p, u_int length, u_int caplen)
   116  {
   117  	const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
   118 -	struct ether_header ehdr;
   119 +	struct tcpdump_ether_header ehdr;
   120  	u_short extracted_ethertype;
   122  	if (caplen < IPFC_HDRLEN) {
   123 Index: print-rrcp.c
   124 --- print-rrcp.c.orig	2010-03-12 02:56:44.000000000 +0100
   125 +++ print-rrcp.c	2010-03-31 09:55:19.000000000 +0200
   126 @@ -88,11 +88,11 @@
   127  	const u_char *rrcp;
   128  	u_int8_t rrcp_proto;
   129  	u_int8_t rrcp_opcode;
   130 -	register const struct ether_header *ep;
   131 +	register const struct tcpdump_ether_header *ep;
   132  	char proto_str[16];
   133  	char opcode_str[32];
   135 -	ep = (const struct ether_header *)cp;
   136 +	ep = (const struct tcpdump_ether_header *)cp;
   137  	rrcp = cp + ETHER_HDRLEN;
   139  	ND_TCHECK(*(rrcp + RRCP_PROTO_OFFSET));
   140 Index: print-token.c
   141 --- print-token.c.orig	2010-03-12 02:56:44.000000000 +0100
   142 +++ print-token.c	2010-03-31 09:51:51.000000000 +0200
   143 @@ -103,7 +103,7 @@
   144  {
   145  	const struct token_header *trp;
   146  	u_short extracted_ethertype;
   147 -	struct ether_header ehdr;
   148 +	struct tcpdump_ether_header ehdr;
   149  	u_int route_len = 0, hdr_len = TOKEN_HDRLEN;
   150  	int seg;
   152 Index: print-pflog.c
   153 --- print-pflog.c.orig	2010-03-12 02:56:44.000000000 +0100
   154 +++ print-pflog.c	2010-03-31 10:00:24.000000000 +0200
   155 @@ -44,6 +44,7 @@
   157  #include "interface.h"
   158  #include "addrtoname.h"
   159 +#include "extract.h"
   161  static struct tok pf_reasons[] = {
   162  	{ 0,	"0(match)" },

mercurial