Update libpcap to version 1.1.1
Signed-off-by: Christoph König <[email protected]>
---
Index: package/libpcap/patches/201-space_optimization.patch
===================================================================
--- package/libpcap/patches/201-space_optimization.patch (revision 26719)
+++ package/libpcap/patches/201-space_optimization.patch (working copy)
@@ -1,6 +1,6 @@
--- a/gencode.c
+++ b/gencode.c
-@@ -439,20 +439,6 @@ pcap_compile_nopcap(int snaplen_arg, int
+@@ -491,20 +491,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
-@@ -698,6 +698,59 @@ static const u_char charmap[] = {
+@@ -748,6 +748,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
-@@ -2278,45 +2278,6 @@ icode_to_fcode(root, lenp)
+@@ -2292,45 +2292,6 @@ icode_to_fcode(root, lenp)
return fp;
}
Index: package/libpcap/patches/202-protocol_api.patch
===================================================================
--- package/libpcap/patches/202-protocol_api.patch (revision 26719)
+++ package/libpcap/patches/202-protocol_api.patch (working copy)
@@ -1,6 +1,6 @@
--- a/pcap-int.h
+++ b/pcap-int.h
-@@ -187,6 +187,7 @@ struct pcap_opt {
+@@ -209,6 +209,7 @@ struct pcap_opt {
char *source;
int promisc;
int rfmon;
@@ -10,25 +10,25 @@
/*
--- a/pcap-linux.c
+++ b/pcap-linux.c
-@@ -273,7 +273,7 @@ static int iface_get_id(int fd, const ch
+@@ -335,7 +335,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
-static int iface_bind(int fd, int ifindex, char *ebuf);
+static int iface_bind(int fd, int ifindex, char *ebuf, unsigned short
proto);
+ #ifdef IW_MODE_MONITOR
static int has_wext(int sock_fd, const char *device, char *ebuf);
- static int enter_rfmon_mode_wext(pcap_t *handle, int sock_fd,
- const char *device);
-@@ -362,7 +362,7 @@ pcap_can_set_rfmon_linux(pcap_t *p)
+ #endif /* IW_MODE_MONITOR */
+@@ -881,7 +881,7 @@ pcap_can_set_rfmon_linux(pcap_t *handle)
* (We assume that if we have Wireless Extensions support
* we also have PF_PACKET support.)
*/
- sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ sock_fd = socket(PF_PACKET, SOCK_RAW, p->opt.proto);
if (sock_fd == -1) {
- (void)snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
+ (void)snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"socket: %s", pcap_strerror(errno));
-@@ -522,6 +522,9 @@ pcap_activate_linux(pcap_t *handle)
+@@ -1128,6 +1128,9 @@ pcap_activate_linux(pcap_t *handle)
handle->read_op = pcap_read_linux;
handle->stats_op = pcap_stats_linux;
@@ -38,7 +38,7 @@
/*
* The "any" device is a special device which causes us not
* to bind to a particular device and thus to look at all
-@@ -1673,8 +1676,8 @@ activate_new(pcap_t *handle)
+@@ -2684,8 +2687,8 @@ activate_new(pcap_t *handle)
* try a SOCK_RAW socket for the raw interface.
*/
sock_fd = is_any_device ?
@@ -49,7 +49,7 @@
if (sock_fd == -1) {
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "socket: %s",
-@@ -1763,7 +1766,7 @@ activate_new(pcap_t *handle)
+@@ -2783,7 +2786,7 @@ activate_new(pcap_t *handle)
return PCAP_ERROR;
}
sock_fd = socket(PF_PACKET, SOCK_DGRAM,
@@ -58,7 +58,7 @@
if (sock_fd == -1) {
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
"socket: %s", pcap_strerror(errno));
-@@ -1815,7 +1818,7 @@ activate_new(pcap_t *handle)
+@@ -2835,7 +2838,7 @@ activate_new(pcap_t *handle)
}
if ((err = iface_bind(sock_fd, handle->md.ifindex,
@@ -67,7 +67,7 @@
close(sock_fd);
if (err < 0)
return err;
-@@ -2440,7 +2443,7 @@ iface_get_id(int fd, const char *device,
+@@ -3640,7 +3643,7 @@ iface_get_id(int fd, const char *device,
* or a PCAP_ERROR_ value on a hard error.
*/
static int
@@ -76,7 +76,7 @@
{
struct sockaddr_ll sll;
int err;
-@@ -2449,7 +2452,7 @@ iface_bind(int fd, int ifindex, char *eb
+@@ -3649,7 +3652,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 +85,7 @@
if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) == -1) {
if (errno == ENETDOWN) {
-@@ -3119,7 +3122,7 @@ activate_old(pcap_t *handle)
+@@ -4359,7 +4362,7 @@ activate_old(pcap_t *handle)
/* Open the socket */
@@ -96,7 +96,7 @@
"socket: %s", pcap_strerror(errno));
--- a/pcap.c
+++ b/pcap.c
-@@ -152,6 +152,8 @@ pcap_create_common(const char *source, c
+@@ -258,6 +258,8 @@ pcap_create_common(const char *source, c
pcap_set_snaplen(p, 65535); /* max packet size */
p->opt.promisc = 0;
p->opt.buffer_size = 0;
@@ -105,10 +105,11 @@
return (p);
}
-@@ -212,6 +214,15 @@ pcap_set_buffer_size(pcap_t *p, int buff
+@@ -317,6 +319,15 @@ pcap_set_buffer_size(pcap_t *p, int buff
+ return 0;
}
- int
++int
+pcap_set_protocol(pcap_t *p, unsigned short proto)
+{
+ if (pcap_check_activated(p))
@@ -117,13 +118,12 @@
+ return 0;
+}
+
-+int
+ int
pcap_activate(pcap_t *p)
{
- int status;
--- a/pcap/pcap.h
+++ b/pcap/pcap.h
-@@ -61,6 +61,7 @@ extern "C" {
+@@ -68,6 +68,7 @@ extern "C" {
#define PCAP_VERSION_MINOR 4
#define PCAP_ERRBUF_SIZE 256
@@ -131,7 +131,7 @@
/*
* Compatibility for systems that have a bpf.h that
-@@ -263,6 +264,7 @@ int pcap_can_set_rfmon(pcap_t *);
+@@ -276,6 +277,7 @@ int pcap_can_set_rfmon(pcap_t *);
int pcap_set_rfmon(pcap_t *, int);
int pcap_set_timeout(pcap_t *, int);
int pcap_set_buffer_size(pcap_t *, int);
Index: package/libpcap/patches/100-debian_shared_lib.patch
===================================================================
--- package/libpcap/patches/100-debian_shared_lib.patch (revision 26719)
+++ package/libpcap/patches/100-debian_shared_lib.patch (working copy)
@@ -23,7 +23,7 @@
#
# You shouldn't need to edit anything below.
#
-@@ -56,6 +64,7 @@ PROG=libpcap
+@@ -59,6 +67,7 @@ PROG=libpcap
# Standard CFLAGS
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
@@ -31,7 +31,7 @@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -75,7 +84,11 @@ YACC = @V_YACC@
+@@ -78,7 +87,11 @@ YACC = @V_YACC@
# problem if you don't own the file but can write to the directory.
.c.o:
@rm -f $@
@@ -42,39 +42,12 @@
+ @rm -f $@
+ $(CC) -fPIC $(CFLAGS) -c -o $@ $(srcdir)/$*.c
- PSRC = pcap-@[email protected] @USB_SRC@ @BT_SRC@
+ PSRC = pcap-@[email protected] @USB_SRC@ @BT_SRC@ @CAN_SRC@
FSRC = fad-@[email protected]
-@@ -90,6 +103,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)
-+OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=_pic.o) $(CSRC:.c=_pic.o)
$(SSRC:.c=_pic.o) $(GENSRC:.c=_pic.o)
- HDR = \
- acconfig.h \
- arcnet.h \
-@@ -122,7 +136,8 @@ TAGHDR = \
- TAGFILES = \
- $(SRC) $(HDR) $(TAGHDR)
+@@ -409,6 +422,13 @@ libpcap.shareda: $(OBJ)
+ #
+ libpcap.none:
--CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
-+CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c \
-+ $(OBJ_PIC) libpcap.so*
-
- MAN1 = pcap-config.1
-
-@@ -311,7 +326,7 @@ EXTRA_DIST = \
- Win32/Src/inet_net.c \
- Win32/Src/inet_pton.c
-
--all: libpcap.a pcap-config
-+all: libpcap.a pcap-config $(SHAREDLIB)
-
- libpcap.a: $(OBJ)
- @rm -f $@
-@@ -344,6 +359,13 @@ libpcap.dylib: $(OBJ)
- -compatibility_version 1 \
- -current_version `sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`
-
+$(SHAREDLIB): $(OBJ_PIC)
+ -@rm -f $@
+ -@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ)
@@ -84,8 +57,8 @@
+
scanner.c: $(srcdir)/scanner.l
@rm -f $@
- ./runlex.sh $(LEX) -o$@ $<
-@@ -351,6 +373,9 @@ scanner.c: $(srcdir)/scanner.l
+ $(srcdir)/runlex.sh $(LEX) -o$@ $<
+@@ -416,6 +436,9 @@ scanner.c: $(srcdir)/scanner.l
scanner.o: scanner.c tokdefs.h
$(CC) $(CFLAGS) -c scanner.c
@@ -95,7 +68,7 @@
pcap.o: version.h
tokdefs.h: grammar.c
-@@ -364,9 +389,17 @@ grammar.o: grammar.c
+@@ -429,9 +452,17 @@ grammar.o: grammar.c
@rm -f $@
$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
@@ -113,7 +86,7 @@
snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
-@@ -392,6 +425,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
+@@ -469,6 +500,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
bpf_filter.o: bpf_filter.c
$(CC) $(CFLAGS) -c bpf_filter.c
@@ -123,35 +96,3 @@
#
# Generate the pcap-config script.
#
-@@ -418,6 +454,9 @@ install: libpcap.a pcap-config
- (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
- $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
- $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
-+ $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/
-+ ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ)
-+ ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY)
- [ -d $(DESTDIR)$(includedir) ] || \
- (mkdir -p $(DESTDIR)$(includedir); chmod 755
$(DESTDIR)$(includedir))
- [ -d $(DESTDIR)$(includedir)/pcap ] || \
---- a/configure
-+++ b/configure
-@@ -8658,7 +8658,7 @@ irix*)
- ;;
-
- linux*)
-- V_CCOPT="$V_CCOPT -fPIC"
-+ V_CCOPT="$V_CCOPT"
- ;;
-
- osf*)
---- a/configure.in
-+++ b/configure.in
-@@ -943,7 +943,7 @@ irix*)
- ;;
-
- linux*)
-- V_CCOPT="$V_CCOPT -fPIC"
-+ V_CCOPT="$V_CCOPT"
- ;;
-
- osf*)
Index: package/libpcap/patches/203-undef_iw_mode_monitor.patch
===================================================================
--- package/libpcap/patches/203-undef_iw_mode_monitor.patch (revision 26719)
+++ package/libpcap/patches/203-undef_iw_mode_monitor.patch (working copy)
@@ -1,6 +1,6 @@
--- a/pcap-linux.c
+++ b/pcap-linux.c
-@@ -194,6 +194,8 @@ static const char rcsid[] _U_ =
+@@ -254,6 +254,8 @@ static const char rcsid[] _U_ =
typedef int socklen_t;
#endif
Index: package/libpcap/Makefile
===================================================================
--- package/libpcap/Makefile (revision 26719)
+++ package/libpcap/Makefile (working copy)
@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libpcap
-PKG_VERSION:=1.0.0
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.1
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.tcpdump.org/release/
-PKG_MD5SUM:=9ad1358c5dec48456405eac197a46d3d
+PKG_MD5SUM:=1bca27d206970badae248cfa471bbb47
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel