From aa5eff3fe80f1681680058399b22404c970f65a9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 5 Feb 2014 09:54:34 +0000 Subject: [PATCH] libpcap: update to current upstream version 1.5.3 -size_of(old libpcap-1.3.0) = 85228 Byte -size_of(new libpcap-1.5.3) = 88587 Byte => ~3.3 KByte increase SVN-Revision: 39473 --- package/libs/libpcap/Makefile | 4 +- .../patches/100-debian_shared_lib.patch | 30 ++++---- .../102-makefile_disable_manpages.patch | 71 +++++++++---------- .../103-makefile_flex_workaround.patch | 4 +- .../patches/201-space_optimization.patch | 8 +-- .../libpcap/patches/202-protocol_api.patch | 58 +++++++-------- .../patches/203-undef_iw_mode_monitor.patch | 2 +- 7 files changed, 87 insertions(+), 90 deletions(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 24b07c932b..347b180ba2 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap -PKG_VERSION:=1.3.0 +PKG_VERSION:=1.5.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.tcpdump.org/release/ -PKG_MD5SUM:=f78455a92622b7a3c05c58b6ad1cec7e +PKG_MD5SUM:=7e7321fb3aff2f2bb05c8229f3795d4a PKG_MAINTAINER:=Felix Fietkau diff --git a/package/libs/libpcap/patches/100-debian_shared_lib.patch b/package/libs/libpcap/patches/100-debian_shared_lib.patch index 30cb10ae37..b294e51576 100644 --- a/package/libs/libpcap/patches/100-debian_shared_lib.patch +++ b/package/libs/libpcap/patches/100-debian_shared_lib.patch @@ -3,7 +3,7 @@ build a shared library. --- a/Makefile.in +++ b/Makefile.in -@@ -40,6 +40,14 @@ +@@ -40,6 +40,14 @@ mandir = @mandir@ srcdir = @srcdir@ VPATH = @srcdir@ @@ -18,7 +18,7 @@ build a shared library. # # You shouldn't need to edit anything below. # -@@ -60,7 +68,8 @@ +@@ -63,7 +71,8 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ PROG=libpcap # Standard CFLAGS @@ -28,7 +28,7 @@ build a shared library. INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ -@@ -80,7 +89,11 @@ +@@ -83,7 +92,11 @@ YACC = @V_YACC@ # problem if you don't own the file but can write to the directory. .c.o: @rm -f $@ @@ -39,9 +39,9 @@ build a shared library. + @rm -f $@ + $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c - PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ @CANUSB_SRC@ + PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ @CANUSB_SRC@ @DBUS_SRC@ FSRC = fad-@V_FINDALLDEVS@.c -@@ -96,6 +109,7 @@ +@@ -99,6 +112,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) @@ -49,7 +49,7 @@ build a shared library. PUBHDR = \ pcap.h \ pcap-bpf.h \ -@@ -148,7 +162,7 @@ +@@ -153,7 +167,7 @@ TAGFILES = \ CLEANFILES = $(OBJ) libpcap.* $(TESTS) \ $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ @@ -58,7 +58,7 @@ build a shared library. MAN1 = pcap-config.1 -@@ -352,7 +366,7 @@ +@@ -363,7 +377,7 @@ libpcap.a: $(OBJ) $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) $(RANLIB) $@ @@ -67,7 +67,7 @@ build a shared library. libpcap.so: $(OBJ) @rm -f $@ -@@ -430,6 +444,13 @@ +@@ -441,6 +455,13 @@ libpcap.shareda: $(OBJ) # libpcap.none: @@ -81,7 +81,7 @@ build a shared library. scanner.c: $(srcdir)/scanner.l @rm -f $@ $(srcdir)/runlex.sh $(LEX) -o$@ $< -@@ -437,6 +458,9 @@ +@@ -448,6 +469,9 @@ scanner.c: $(srcdir)/scanner.l scanner.o: scanner.c tokdefs.h $(CC) $(FULL_CFLAGS) -c scanner.c @@ -91,7 +91,7 @@ build a shared library. pcap.o: version.h tokdefs.h: grammar.c -@@ -450,9 +474,16 @@ +@@ -461,9 +485,16 @@ grammar.o: grammar.c @rm -f $@ $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c @@ -108,7 +108,7 @@ build a shared library. snprintf.o: $(srcdir)/missing/snprintf.c $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c -@@ -490,6 +521,9 @@ +@@ -501,6 +532,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt bpf_filter.o: bpf_filter.c $(CC) $(FULL_CFLAGS) -c bpf_filter.c @@ -118,7 +118,7 @@ build a shared library. # # Generate the pcap-config script. # -@@ -607,11 +641,9 @@ +@@ -618,11 +652,9 @@ install-shared: install-shared-$(DYEXT) install-shared-so: libpcap.so [ -d $(DESTDIR)$(libdir) ] || \ (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) @@ -135,7 +135,7 @@ build a shared library. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) --- a/aclocal.m4 +++ b/aclocal.m4 -@@ -262,7 +262,7 @@ +@@ -440,7 +440,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, esac ;; esac @@ -144,7 +144,7 @@ build a shared library. V_SONAME_OPT="-Wl,-soname," V_RPATH_OPT="-Wl,-rpath," ;; -@@ -325,7 +325,7 @@ +@@ -503,7 +503,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, # # "cc" is GCC. # @@ -155,7 +155,7 @@ build a shared library. V_SONAME_OPT="-Wl,-soname," --- a/pcap-config.in +++ b/pcap-config.in -@@ -36,16 +36,6 @@ +@@ -36,16 +36,6 @@ do esac shift done diff --git a/package/libs/libpcap/patches/102-makefile_disable_manpages.patch b/package/libs/libpcap/patches/102-makefile_disable_manpages.patch index 50ea2211af..e49b3acc28 100644 --- a/package/libs/libpcap/patches/102-makefile_disable_manpages.patch +++ b/package/libs/libpcap/patches/102-makefile_disable_manpages.patch @@ -1,6 +1,6 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -571,71 +571,12 @@ install: install-shared install-archive +@@ -585,68 +585,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) @@ -27,42 +27,39 @@ - for i in $(MAN3PCAP_EXPAND:.in=); do \ - $(INSTALL_DATA) $$i \ - $(DESTDIR)$(mandir)/man3/$$i; done -- rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap -- ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \ -- $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap -- 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 -- rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap -- ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \ -- $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap -- rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap -- ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \ -- $(DESTDIR)$(mandir)/man3/pcap_next.3pcap -- rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap -- ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \ -- $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap -- rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap -- ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \ -- $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap +- (cd $(DESTDIR)$(mandir)/man3 && \ +- rm -f pcap_datalink_val_to_description.3pcap && \ +- $(LN_S) pcap_datalink_val_to_name.3pcap \ +- pcap_datalink_val_to_description.3pcap && \ +- rm -f pcap_dump_fopen.3pcap && \ +- $(LN_S) pcap_dump_open.3pcap pcap_dump_fopen.3pcap && \ +- rm -f pcap_freealldevs.3pcap && \ +- $(LN_S) pcap_findalldevs.3pcap pcap_freealldevs.3pcap && \ +- rm -f pcap_perror.3pcap && \ +- $(LN_S) pcap_geterr.3pcap pcap_perror.3pcap && \ +- rm -f pcap_sendpacket.3pcap && \ +- $(LN_S) pcap_inject.3pcap pcap_sendpacket.3pcap && \ +- rm -f pcap_free_datalinks.3pcap && \ +- $(LN_S) pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap && \ +- rm -f pcap_free_tstamp_types.3pcap && \ +- $(LN_S) pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap && \ +- rm -f pcap_dispatch.3pcap && \ +- $(LN_S) pcap_loop.3pcap pcap_dispatch.3pcap && \ +- rm -f pcap_minor_version.3pcap && \ +- $(LN_S) pcap_major_version.3pcap pcap_minor_version.3pcap && \ +- rm -f pcap_next.3pcap && \ +- $(LN_S) pcap_next_ex.3pcap pcap_next.3pcap && \ +- rm -f pcap_open_dead_with_tstamp_precision.3pcap && \ +- $(LN_S) pcap_open_dead.3pcap \ +- pcap_open_dead_with_tstamp_precision.3pcap && \ +- rm -f pcap_open_offline_with_tstamp_precision.3pcap && \ +- $(LN_S) pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap && \ +- rm -f pcap_fopen_offline.3pcap && \ +- $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline.3pcap && \ +- rm -f pcap_fopen_offline_with_tstamp_precision.3pcap && \ +- $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap && \ +- rm -f pcap_getnonblock.3pcap && \ +- $(LN_S) pcap_setnonblock.3pcap pcap_getnonblock.3pcap) - for i in $(MANFILE); do \ - $(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \ - $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done diff --git a/package/libs/libpcap/patches/103-makefile_flex_workaround.patch b/package/libs/libpcap/patches/103-makefile_flex_workaround.patch index a90e0ce1a3..f5427261e1 100644 --- a/package/libs/libpcap/patches/103-makefile_flex_workaround.patch +++ b/package/libs/libpcap/patches/103-makefile_flex_workaround.patch @@ -3,8 +3,8 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -56,7 +56,7 @@ LD = /usr/bin/ld - CC = @CC@ +@@ -59,7 +59,7 @@ LN_S = @LN_S@ + MKDEP = @MKDEP@ CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ -DEFS = @DEFS@ @V_DEFS@ diff --git a/package/libs/libpcap/patches/201-space_optimization.patch b/package/libs/libpcap/patches/201-space_optimization.patch index f3eec4c839..ee3cd3b858 100644 --- a/package/libs/libpcap/patches/201-space_optimization.patch +++ b/package/libs/libpcap/patches/201-space_optimization.patch @@ -1,6 +1,6 @@ --- a/gencode.c +++ b/gencode.c -@@ -491,20 +491,6 @@ pcap_compile_nopcap(int snaplen_arg, int +@@ -511,20 +511,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[] = { +@@ -1075,6 +1075,59 @@ static const u_char charmap[] = { (u_char)'\374', (u_char)'\375', (u_char)'\376', (u_char)'\377', }; @@ -85,7 +85,7 @@ { --- a/optimize.c +++ b/optimize.c -@@ -2292,45 +2292,6 @@ icode_to_fcode(root, lenp) +@@ -2193,45 +2193,6 @@ icode_to_fcode(struct block *root, u_int return fp; } @@ -130,4 +130,4 @@ - #ifdef BDEBUG static void - opt_dump(root) + opt_dump(struct block *root) diff --git a/package/libs/libpcap/patches/202-protocol_api.patch b/package/libs/libpcap/patches/202-protocol_api.patch index fabbac73f1..c02f842776 100644 --- a/package/libs/libpcap/patches/202-protocol_api.patch +++ b/package/libs/libpcap/patches/202-protocol_api.patch @@ -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) */ - int tstamp_type; - }; - --- a/pcap-linux.c +++ b/pcap-linux.c -@@ -363,7 +363,7 @@ static int iface_get_id(int fd, const ch +@@ -380,7 +380,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 */ -@@ -980,7 +980,7 @@ pcap_can_set_rfmon_linux(pcap_t *handle) +@@ -963,7 +963,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)); -@@ -1266,6 +1266,9 @@ pcap_activate_linux(pcap_t *handle) +@@ -1251,6 +1251,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 -@@ -2897,8 +2900,8 @@ activate_new(pcap_t *handle) +@@ -3012,8 +3015,8 @@ activate_new(pcap_t *handle) * try a SOCK_RAW socket for the raw interface. */ sock_fd = is_any_device ? @@ -49,7 +39,7 @@ if (sock_fd == -1) { if (errno == EINVAL || errno == EAFNOSUPPORT) { -@@ -3015,7 +3018,7 @@ activate_new(pcap_t *handle) +@@ -3130,7 +3133,7 @@ activate_new(pcap_t *handle) return PCAP_ERROR; } sock_fd = socket(PF_PACKET, SOCK_DGRAM, @@ -58,16 +48,16 @@ if (sock_fd == -1) { snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "socket: %s", pcap_strerror(errno)); -@@ -3078,7 +3081,7 @@ activate_new(pcap_t *handle) +@@ -3193,7 +3196,7 @@ activate_new(pcap_t *handle) } - if ((err = iface_bind(sock_fd, handle->md.ifindex, + if ((err = iface_bind(sock_fd, handlep->ifindex, - handle->errbuf)) != 1) { + handle->errbuf, handle->opt.proto)) != 1) { close(sock_fd); if (err < 0) return err; -@@ -4149,7 +4152,7 @@ iface_get_id(int fd, const char *device, +@@ -4667,7 +4670,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; -@@ -4158,7 +4161,7 @@ iface_bind(int fd, int ifindex, char *eb +@@ -4676,7 +4679,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) { -@@ -5040,7 +5043,7 @@ activate_old(pcap_t *handle) +@@ -5561,7 +5564,7 @@ activate_old(pcap_t *handle) /* Open the socket */ @@ -96,15 +86,15 @@ "socket: %s", pcap_strerror(errno)); --- a/pcap.c +++ b/pcap.c -@@ -309,6 +309,7 @@ pcap_create_common(const char *source, c - pcap_set_snaplen(p, 65535); /* max packet size */ +@@ -556,6 +556,7 @@ pcap_create_common(const char *source, c p->opt.promisc = 0; - p->opt.buffer_size = 0; + p->opt.rfmon = 0; + p->opt.immediate = 0; + p->opt.proto = -1; p->opt.tstamp_type = -1; /* default to not setting time stamp type */ + p->opt.tstamp_precision = PCAP_TSTAMP_PRECISION_MICRO; return (p); - } -@@ -405,6 +406,15 @@ pcap_set_buffer_size(pcap_t *p, int buff +@@ -713,6 +714,15 @@ pcap_get_tstamp_precision(pcap_t *p) } int @@ -130,11 +120,21 @@ /* * Compatibility for systems that have a bpf.h that -@@ -280,6 +281,7 @@ int pcap_set_rfmon(pcap_t *, int); - int pcap_set_timeout(pcap_t *, int); +@@ -283,6 +284,7 @@ int pcap_set_timeout(pcap_t *, int); int pcap_set_tstamp_type(pcap_t *, int); + int pcap_set_immediate_mode(pcap_t *, int); int pcap_set_buffer_size(pcap_t *, int); +int pcap_set_protocol(pcap_t *, unsigned short); + int pcap_set_tstamp_precision(pcap_t *, int); + int pcap_get_tstamp_precision(pcap_t *); int pcap_activate(pcap_t *); - - int pcap_list_tstamp_types(pcap_t *, int **); +--- a/pcap-int.h ++++ b/pcap-int.h +@@ -88,6 +88,7 @@ struct pcap_opt { + char *source; + int timeout; /* timeout for buffering */ + int buffer_size; ++ int proto; /* protocol for packet socket (linux) */ + int promisc; + int rfmon; /* monitor mode */ + int immediate; /* immediate mode - deliver packets as soon as they arrive */ diff --git a/package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch b/package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch index 508c6590a5..ce1acdc7db 100644 --- a/package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch +++ b/package/libs/libpcap/patches/203-undef_iw_mode_monitor.patch @@ -1,6 +1,6 @@ --- a/pcap-linux.c +++ b/pcap-linux.c -@@ -254,6 +254,8 @@ static const char rcsid[] _U_ = +@@ -249,6 +249,8 @@ static const char rcsid[] _U_ = typedef int socklen_t; #endif -- 2.30.2