This patch updates libpcap to version 1.3.0

Signed-off-by: Christoph König <christoph.koenig+open...@gmail.com>
---
Index: package/libs/libpcap/patches/201-space_optimization.patch
===================================================================
--- package/libs/libpcap/patches/201-space_optimization.patch   (Revision 34497)
+++ package/libs/libpcap/patches/201-space_optimization.patch   (Arbeitskopie)
@@ -1,6 +1,6 @@
 --- a/gencode.c
 +++ b/gencode.c
-@@ -491,20 +491,6 @@ pcap_compile_nopcap(int snaplen_arg, int
+@@ -496,20 +496,6 @@ pcap_compile_nopcap(int snaplen_arg, int
  }

  /*
@@ -23,7 +23,7 @@
   * back to another unresolved block (or nil).  At least one of the fields
 --- a/pcap.c
 +++ b/pcap.c
-@@ -748,6 +748,59 @@ static const u_char charmap[] = {
+@@ -740,6 +740,59 @@ static const u_char charmap[] = {
        (u_char)'\374', (u_char)'\375', (u_char)'\376', (u_char)'\377',
  };

@@ -131,3 +131,13 @@
  #ifdef BDEBUG
  static void
  opt_dump(root)
+--- a/pcap-int.h
++++ b/pcap-int.h
+@@ -210,6 +210,7 @@ struct pcap_opt {
+       int     promisc;
+       int     rfmon;
+       int     tstamp_type;
++      int     proto;
+ };
+
+ /*
Index: package/libs/libpcap/patches/103-makefile_flex_workaround.patch
===================================================================
--- package/libs/libpcap/patches/103-makefile_flex_workaround.patch     
(Revision 34497)
+++ package/libs/libpcap/patches/103-makefile_flex_workaround.patch     
(Arbeitskopie)
@@ -3,8 +3,8 @@

 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -56,7 +56,7 @@ LD = /usr/bin/ld
- CC = @CC@
+@@ -57,7 +57,7 @@ CC = @CC@
+ AR = @AR@
  CCOPT = @V_CCOPT@
  INCLS = -I. @V_INCLS@
 -DEFS = @DEFS@ @V_DEFS@
Index: package/libs/libpcap/patches/202-protocol_api.patch
===================================================================
--- package/libs/libpcap/patches/202-protocol_api.patch (Revision 34497)
+++ package/libs/libpcap/patches/202-protocol_api.patch (Arbeitskopie)
@@ -1,16 +1,6 @@
---- a/pcap-int.h
-+++ b/pcap-int.h
-@@ -209,6 +209,7 @@ struct pcap_opt {
-       char    *source;
-       int     promisc;
-       int     rfmon;
-+      int proto;      /* protocol for packet socket (linux) */
- };
-
- /*
 --- a/pcap-linux.c
 +++ b/pcap-linux.c
-@@ -335,7 +335,7 @@ static int iface_get_id(int fd, const ch
+@@ -363,7 +363,7 @@ static int iface_get_id(int fd, const ch
  static int    iface_get_mtu(int fd, const char *device, char *ebuf);
  static int    iface_get_arptype(int fd, const char *device, char *ebuf);
  #ifdef HAVE_PF_PACKET_SOCKETS
@@ -19,7 +9,7 @@
  #ifdef IW_MODE_MONITOR
  static int    has_wext(int sock_fd, const char *device, char *ebuf);
  #endif /* IW_MODE_MONITOR */
-@@ -881,7 +881,7 @@ pcap_can_set_rfmon_linux(pcap_t *handle)
+@@ -980,7 +980,7 @@ pcap_can_set_rfmon_linux(pcap_t *handle)
         * (We assume that if we have Wireless Extensions support
         * we also have PF_PACKET support.)
         */
@@ -28,7 +18,7 @@
        if (sock_fd == -1) {
                (void)snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
                    "socket: %s", pcap_strerror(errno));
-@@ -1128,6 +1128,9 @@ pcap_activate_linux(pcap_t *handle)
+@@ -1266,6 +1266,9 @@ pcap_activate_linux(pcap_t *handle)
        handle->read_op = pcap_read_linux;
        handle->stats_op = pcap_stats_linux;

@@ -38,7 +28,7 @@
        /*
         * The "any" device is a special device which causes us not
         * to bind to a particular device and thus to look at all
-@@ -2684,8 +2687,8 @@ activate_new(pcap_t *handle)
+@@ -2897,8 +2900,8 @@ activate_new(pcap_t *handle)
         * try a SOCK_RAW socket for the raw interface.
         */
        sock_fd = is_any_device ?
@@ -48,8 +38,8 @@
 +              socket(PF_PACKET, SOCK_RAW, handle->opt.proto);

        if (sock_fd == -1) {
-               snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "socket: %s",
-@@ -2783,7 +2786,7 @@ activate_new(pcap_t *handle)
+               if (errno == EINVAL || errno == EAFNOSUPPORT) {
+@@ -3015,7 +3018,7 @@ activate_new(pcap_t *handle)
                                return PCAP_ERROR;
                        }
                        sock_fd = socket(PF_PACKET, SOCK_DGRAM,
@@ -58,7 +48,7 @@
                        if (sock_fd == -1) {
                                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
                                    "socket: %s", pcap_strerror(errno));
-@@ -2835,7 +2838,7 @@ activate_new(pcap_t *handle)
+@@ -3078,7 +3081,7 @@ activate_new(pcap_t *handle)
                }

                if ((err = iface_bind(sock_fd, handle->md.ifindex,
@@ -67,7 +57,7 @@
                        close(sock_fd);
                        if (err < 0)
                                return err;
-@@ -3640,7 +3643,7 @@ iface_get_id(int fd, const char *device,
+@@ -4149,7 +4152,7 @@ iface_get_id(int fd, const char *device,
   *  or a PCAP_ERROR_ value on a hard error.
   */
  static int
@@ -76,7 +66,7 @@
  {
        struct sockaddr_ll      sll;
        int                     err;
-@@ -3649,7 +3652,7 @@ iface_bind(int fd, int ifindex, char *eb
+@@ -4158,7 +4161,7 @@ iface_bind(int fd, int ifindex, char *eb
        memset(&sll, 0, sizeof(sll));
        sll.sll_family          = AF_PACKET;
        sll.sll_ifindex         = ifindex;
@@ -85,7 +75,7 @@

        if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) == -1) {
                if (errno == ENETDOWN) {
-@@ -4359,7 +4362,7 @@ activate_old(pcap_t *handle)
+@@ -5040,7 +5043,7 @@ activate_old(pcap_t *handle)

        /* Open the socket */

@@ -96,20 +86,18 @@
                         "socket: %s", pcap_strerror(errno));
 --- a/pcap.c
 +++ b/pcap.c
-@@ -258,6 +258,8 @@ pcap_create_common(const char *source, c
-       pcap_set_snaplen(p, 65535);     /* max packet size */
+@@ -310,6 +310,7 @@ pcap_create_common(const char *source, c
        p->opt.promisc = 0;
        p->opt.buffer_size = 0;
+       p->opt.tstamp_type = -1;        /* default to not setting time stamp 
type */
 +      p->opt.proto = -1;
-+
        return (p);
  }

-@@ -317,6 +319,15 @@ pcap_set_buffer_size(pcap_t *p, int buff
-       return 0;
+@@ -405,6 +406,15 @@ pcap_set_buffer_size(pcap_t *p, int buff
  }

-+int
+ int
 +pcap_set_protocol(pcap_t *p, unsigned short proto)
 +{
 +      if (pcap_check_activated(p))
@@ -118,9 +106,10 @@
 +      return 0;
 +}
 +
- int
++int
  pcap_activate(pcap_t *p)
  {
+       int status;
 --- a/pcap/pcap.h
 +++ b/pcap/pcap.h
 @@ -68,6 +68,7 @@ extern "C" {
@@ -131,11 +120,11 @@

  /*
   * Compatibility for systems that have a bpf.h that
-@@ -276,6 +277,7 @@ int        pcap_can_set_rfmon(pcap_t *);
- int   pcap_set_rfmon(pcap_t *, int);
+@@ -280,6 +281,7 @@ int        pcap_set_rfmon(pcap_t *, int);
  int   pcap_set_timeout(pcap_t *, int);
+ int   pcap_set_tstamp_type(pcap_t *, int);
  int   pcap_set_buffer_size(pcap_t *, int);
 +int   pcap_set_protocol(pcap_t *, unsigned short);
  int   pcap_activate(pcap_t *);

- pcap_t        *pcap_open_live(const char *, int, int, int, char *);
+ int   pcap_list_tstamp_types(pcap_t *, int **);
Index: package/libs/libpcap/patches/102-makefile_disable_manpages.patch
===================================================================
--- package/libs/libpcap/patches/102-makefile_disable_manpages.patch    
(Revision 34497)
+++ package/libs/libpcap/patches/102-makefile_disable_manpages.patch    
(Arbeitskopie)
@@ -1,6 +1,6 @@
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -532,62 +532,12 @@ install: install-shared install-archive
+@@ -567,71 +567,12 @@ install: install-shared install-archive
            (mkdir -p $(DESTDIR)$(includedir); chmod 755 
$(DESTDIR)$(includedir))
        [ -d $(DESTDIR)$(includedir)/pcap ] || \
            (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 
$(DESTDIR)$(includedir)/pcap)
@@ -33,12 +33,21 @@
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
 -      ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
 -               $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+-      rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
+-      ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3pcap \
+-               $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
 -      ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
 -               $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
 -      ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
 -               $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+-      rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
+-      ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3pcap \
+-               $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
+-      rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap
+-      ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3pcap \
+-               $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
 -      ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
 -               $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
@@ -63,7 +72,7 @@

  install-shared: install-shared-$(DYEXT)
  install-shared-so: $(SHAREDLIB)
-@@ -642,23 +592,6 @@ uninstall: uninstall-shared
+@@ -686,26 +627,6 @@ uninstall: uninstall-shared
                rm -f $(DESTDIR)$(includedir)/$$i; done
        -rmdir $(DESTDIR)$(includedir)/pcap
        rm -f $(DESTDIR)/$(bindir)/pcap-config
@@ -73,8 +82,11 @@
 -              rm -f $(DESTDIR)$(mandir)/man3/$$i; done
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
+-      rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
+-      rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
+-      rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
 -      rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
Index: package/libs/libpcap/patches/100-debian_shared_lib.patch
===================================================================
--- package/libs/libpcap/patches/100-debian_shared_lib.patch    (Revision 34497)
+++ package/libs/libpcap/patches/100-debian_shared_lib.patch    (Arbeitskopie)
@@ -8,6 +8,12 @@

 --- a/Makefile.in
 +++ b/Makefile.in
+@@ -1,4 +1,4 @@
+-#  Copyright (c) 1993, 1994, 1995, 1996
++:#  Copyright (c) 1993, 1994, 1995, 1996
+ #     The Regents of the University of California.  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
 @@ -40,6 +40,14 @@ mandir = @mandir@
  srcdir = @srcdir@
  VPATH = @srcdir@
@@ -23,28 +29,28 @@
  #
  # You shouldn't need to edit anything below.
  #
-@@ -59,6 +67,7 @@ PROG=libpcap
-
- # Standard CFLAGS
- CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
+@@ -54,6 +62,7 @@ ADDLOBJS = @ADDLOBJS@
+ ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
+ LIBS = @LIBS@
+ CFLAGS = @CFLAGS@
 +CFLAGS_SHARED = -shared -Wl,-soname,$(SOLIBRARY).$(MAJ)
-
- INSTALL = @INSTALL@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -78,7 +87,11 @@ YACC = @V_YACC@
+ LDFLAGS = @LDFLAGS@
+ DYEXT = @DYEXT@
+ V_RPATH_OPT = @V_RPATH_OPT@
+@@ -80,7 +89,11 @@ YACC = @V_YACC@
  # problem if you don't own the file but can write to the directory.
  .c.o:
        @rm -f $@
--      $(CC) $(CFLAGS) -c $(srcdir)/$*.c
-+      $(CC) $(CFLAGS) -c -o $@ $(srcdir)/$*.c
+-      $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
++      $(CC) $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c
 +
 +%_pic.o: %.c
 +      @rm -f $@
-+      $(CC) -fPIC $(CFLAGS) -c -o $@ $(srcdir)/$*.c
++      $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c

- PSRC =        pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@
+ PSRC =        pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ 
@CANUSB_SRC@
  FSRC =  fad-@V_FINDALLDEVS@.c
-@@ -94,6 +107,7 @@ SRC =       $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
+@@ -96,6 +109,7 @@ SRC =       $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
  # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
  # hack the extra indirection
  OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) 
$(LIBOBJS)
@@ -52,16 +58,16 @@
  PUBHDR = \
        pcap.h \
        pcap-bpf.h \
-@@ -131,7 +145,7 @@ TAGFILES = \
+@@ -148,7 +162,7 @@ TAGFILES = \

- CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \
-       opentest $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
+ CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
+       $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
 -      lex.yy.c pcap-config
 +      lex.yy.c pcap-config $(OBJ_PIC)

  MAN1 = pcap-config.1

-@@ -324,21 +338,14 @@ EXTRA_DIST = \
+@@ -345,21 +359,14 @@ EXTRA_DIST = \
        Win32/Src/inet_net.c \
        Win32/Src/inet_pton.c

@@ -70,7 +76,7 @@

  libpcap.a: $(OBJ)
        @rm -f $@
-       ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
+       $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
        $(RANLIB) $@

 -shared: libpcap.$(DYEXT)
@@ -85,7 +91,7 @@

  #
  # The following rule succeeds, but the result is untested.
-@@ -409,6 +416,13 @@ libpcap.shareda: $(OBJ)
+@@ -430,6 +437,13 @@ libpcap.shareda: $(OBJ)
  #
  libpcap.none:

@@ -99,45 +105,44 @@
  scanner.c: $(srcdir)/scanner.l
        @rm -f $@
        $(srcdir)/runlex.sh $(LEX) -o$@ $<
-@@ -416,6 +430,9 @@ scanner.c: $(srcdir)/scanner.l
+@@ -437,6 +451,9 @@ scanner.c: $(srcdir)/scanner.l
  scanner.o: scanner.c tokdefs.h
-       $(CC) $(CFLAGS) -c scanner.c
+       $(CC) $(FULL_CFLAGS) -c scanner.c

 +scanner_pic.o: scanner.c tokdefs.h
-+      $(CC) -fPIC $(CFLAGS) -o $@ -c scanner.c
++      $(CC) -fPIC $(FULL_CFLAGS) -o $@ -c scanner.c
 +
  pcap.o: version.h

  tokdefs.h: grammar.c
-@@ -429,9 +446,17 @@ grammar.o: grammar.c
+@@ -450,9 +467,16 @@ grammar.o: grammar.c
        @rm -f $@
-       $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
+       $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c

 +grammar_pic.o: grammar.c
 +      @rm -f $@
-+      $(CC) -fPIC $(CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c
++      $(CC) -fPIC $(FULL_CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c
 +
  version.o: version.c
-       $(CC) $(CFLAGS) -c version.c
+       $(CC) $(FULL_CFLAGS) -c version.c

 +version_pic.o: version.c
-+      $(CC) -fPIC $(CFLAGS) -c version.c -o $@
++      $(CC) -fPIC $(FULL_CFLAGS) -c version.c -o $@
 +
-+
  snprintf.o: $(srcdir)/missing/snprintf.c
-       $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
+       $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c

-@@ -469,6 +494,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
+@@ -490,6 +514,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
  bpf_filter.o: bpf_filter.c
-       $(CC) $(CFLAGS) -c bpf_filter.c
+       $(CC) $(FULL_CFLAGS) -c bpf_filter.c

 +bpf_filter_pic.o: bpf_filter.c
-+      $(CC) -fPIC $(CFLAGS) -c bpf_filter.c -o $@
++      $(CC) -fPIC $(FULL_CFLAGS) -c bpf_filter.c -o $@
 +
  #
  # Generate the pcap-config script.
  #
-@@ -562,14 +590,12 @@ install: install-shared install-archive
+@@ -604,14 +631,12 @@ install: install-shared install-archive
                    $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 
's/.manmisc.in/.@MAN_MISC_INFO@/'`; done

  install-shared: install-shared-$(DYEXT)
@@ -158,17 +163,8 @@
            (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
 --- a/configure
 +++ b/configure
-@@ -3229,7 +3229,7 @@ _ACEOF
-                   # or accepts command-line arguments like
-                   # those the GNU linker accepts.
+@@ -3568,7 +3568,7 @@ $as_echo "#define const /**/" >>confdefs
                    #
--                  V_CCOPT="$V_CCOPT -fpic"
-+                  V_CCOPT="$V_CCOPT"
-                   V_SONAME_OPT="-Wl,-soname,"
-                   V_RPATH_OPT="-Wl,-rpath,"
-                   ;;
-@@ -3292,7 +3292,7 @@ _ACEOF
-                   #
                    # "cc" is GCC.
                    #
 -                  V_CCOPT="$V_CCOPT -fpic"
Index: package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch
===================================================================
--- package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch        
(Revision 34497)
+++ package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch        
(Arbeitskopie)
@@ -1,6 +1,6 @@
 --- a/pcap-linux.c
 +++ b/pcap-linux.c
-@@ -254,6 +254,8 @@ static const char rcsid[] _U_ =
+@@ -282,6 +282,8 @@ static const char rcsid[] _U_ =
  typedef int           socklen_t;
  #endif

Index: package/libs/libpcap/Makefile
===================================================================
--- package/libs/libpcap/Makefile       (Revision 34497)
+++ package/libs/libpcap/Makefile       (Arbeitskopie)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk

 PKG_NAME:=libpcap
-PKG_VERSION:=1.1.1
-PKG_RELEASE:=2
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1

 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tcpdump.org/release/
-PKG_MD5SUM:=1bca27d206970badae248cfa471bbb47
+PKG_MD5SUM:=f78455a92622b7a3c05c58b6ad1cec7e

 PKG_MAINTAINER:=Felix Fietkau <n...@openwrt.org>

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to