summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-04 06:57:28 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-04 06:57:28 -0800
commit7b57f580b0e441307a7b463267da893beed624a6 (patch)
tree9324646eadd091d446d9f5b77a0cb6f8167ff26d
parent71040993a907ce0e6bb2c9fb2f824a0bf963afe6 (diff)
downloadlibpcap-7b57f580b0e441307a7b463267da893beed624a6.tar.gz
libpcap-7b57f580b0e441307a7b463267da893beed624a6.tar.bz2
libpcap-7b57f580b0e441307a7b463267da893beed624a6.zip
remove patches from spec
-rw-r--r--packaging/baselibs.conf4
-rw-r--r--packaging/libpcap-1.0.0-filter-fix.patch48
-rw-r--r--packaging/libpcap-1.0.0-pcap-bpf.patch30
-rw-r--r--packaging/libpcap-1.0.0-ppp.patch12
-rw-r--r--packaging/libpcap-1.0.0-s390.patch14
-rw-r--r--packaging/libpcap-ocloexec.patch355
-rw-r--r--packaging/libpcap.spec13
-rw-r--r--packaging/pcap.spec.in77
8 files changed, 2 insertions, 551 deletions
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
index 48d3c64..01e18cc 100644
--- a/packaging/baselibs.conf
+++ b/packaging/baselibs.conf
@@ -1,4 +1,2 @@
-libpcap1
+libpcap
libpcap-devel
- requires -libpcap-<targettype>
- requires "libpcap1-<targettype> = <version>"
diff --git a/packaging/libpcap-1.0.0-filter-fix.patch b/packaging/libpcap-1.0.0-filter-fix.patch
deleted file mode 100644
index 15e8bba..0000000
--- a/packaging/libpcap-1.0.0-filter-fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Index: pcap-bpf.c
-===================================================================
---- pcap-bpf.c.orig
-+++ pcap-bpf.c
-@@ -483,7 +483,7 @@ bpf_open(pcap_t *p)
- fd = open(device, O_RDWR);
- if (fd == -1 && errno == EACCES)
- fd = open(device, O_RDONLY);
-- } while (fd < 0 && errno == EBUSY);
-+ } while (fd < 0 && errno == EBUSY && n < 1000);
-
- /*
- * XXX better message for all minors used
-Index: pcap-linux.c
-===================================================================
---- pcap-linux.c.orig
-+++ pcap-linux.c
-@@ -2421,8 +2421,30 @@ pcap_setfilter_linux_common(pcap_t *hand
- if (can_filter_in_kernel) {
- if ((err = set_kernel_filter(handle, &fcode)) == 0)
- {
-+ char buf[1024];
-+ int oldflags;
-+ int ret;
-+ unsigned int received = 0, rec_len = 0;
-+ socklen_t optlen = sizeof(rec_len);
- /* Installation succeded - using kernel filter. */
- handle->md.use_bpf = 1;
-+
-+ oldflags = fcntl(handle->fd, F_GETFL, 0);
-+ oldflags |= O_NONBLOCK;
-+ fcntl(handle->fd, F_SETFL, oldflags);
-+ getsockopt(handle->fd, SOL_SOCKET, SO_RCVBUF,
-+ (char *)&rec_len, &optlen);
-+
-+ /* now read all packets received until now */
-+ while((ret = read(handle->fd, buf, 1024)) > 0
-+ && received < rec_len) {
-+ received += ret;
-+ }
-+
-+ if(oldflags > 0) {
-+ oldflags &= ~O_NONBLOCK;
-+ fcntl(handle->fd, F_SETFL, oldflags);
-+ }
- }
- else if (err == -1) /* Non-fatal error */
- {
diff --git a/packaging/libpcap-1.0.0-pcap-bpf.patch b/packaging/libpcap-1.0.0-pcap-bpf.patch
deleted file mode 100644
index 7dc8a82..0000000
--- a/packaging/libpcap-1.0.0-pcap-bpf.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Index: pcap/bpf.h
-===================================================================
---- pcap/bpf.h.orig
-+++ pcap/bpf.h
-@@ -102,6 +102,25 @@ typedef u_int bpf_u_int32;
- #define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
-
- /*
-+ * Struct returned by BIOCGSTATS.
-+ */
-+struct bpf_stat {
-+ u_int bs_recv; /* number of packets received */
-+ u_int bs_drop; /* number of packets dropped */
-+};
-+
-+/*
-+ * Structure prepended to each packet.
-+ */
-+struct bpf_hdr {
-+ struct timeval bh_tstamp; /* time stamp */
-+ bpf_u_int32 bh_caplen; /* length of captured portion */
-+ bpf_u_int32 bh_datalen; /* original length of packet */
-+ u_short bh_hdrlen; /* length of bpf header (this struct
-+ plus alignment padding) */
-+};
-+
-+/*
- * Structure for "pcap_compile()", "pcap_setfilter()", etc..
- */
- struct bpf_program {
diff --git a/packaging/libpcap-1.0.0-ppp.patch b/packaging/libpcap-1.0.0-ppp.patch
deleted file mode 100644
index fcc4c12..0000000
--- a/packaging/libpcap-1.0.0-ppp.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: gencode.c
-===================================================================
---- gencode.c.orig
-+++ gencode.c
-@@ -7483,6 +7483,7 @@ gen_inbound(dir)
- */
- switch (linktype) {
- case DLT_SLIP:
-+ case DLT_PPP:
- b0 = gen_relation(BPF_JEQ,
- gen_load(Q_LINK, gen_loadi(0), 1),
- gen_loadi(0),
diff --git a/packaging/libpcap-1.0.0-s390.patch b/packaging/libpcap-1.0.0-s390.patch
deleted file mode 100644
index f265dd5..0000000
--- a/packaging/libpcap-1.0.0-s390.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: pcap-linux.c
-===================================================================
---- pcap-linux.c.orig
-+++ pcap-linux.c
-@@ -3092,6 +3092,9 @@ activate_new(pcap_t *handle)
- else
- return 0; /* try old mechanism */
- }
-+ /* Hack to make things work on s390 ctc interfaces */
-+ if (strncmp("ctc", device, 3) == 0)
-+ handle->linktype = DLT_EN10MB;
- } else {
- /*
- * The "any" device.
diff --git a/packaging/libpcap-ocloexec.patch b/packaging/libpcap-ocloexec.patch
deleted file mode 100644
index e9df063..0000000
--- a/packaging/libpcap-ocloexec.patch
+++ /dev/null
@@ -1,355 +0,0 @@
---- sf-pcap.c.orig
-+++ sf-pcap.c
-@@ -550,7 +550,7 @@ pcap_dump_open(pcap_t *p, const char *fn
- fname = "standard output";
- } else {
- #if !defined(WIN32) && !defined(MSDOS)
-- f = fopen(fname, "w");
-+ f = fopen(fname, "we");
- #else
- f = fopen(fname, "wb");
- #endif
---- pcap-linux.c.orig
-+++ pcap-linux.c
-@@ -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.)
- */
-- sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
-+ sock_fd = socket(PF_PACKET, SOCK_RAW|SOCK_CLOEXEC, htons(ETH_P_ALL));
- if (sock_fd == -1) {
- (void)snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
-@@ -1508,7 +1508,7 @@ pcap_read_packet(pcap_t *handle, pcap_ha
- }
-
- #if defined(HAVE_PACKET_AUXDATA) && defined(HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI)
-- packet_len = recvmsg(handle->fd, &msg, MSG_TRUNC);
-+ packet_len = recvmsg(handle->fd, &msg, MSG_TRUNC|MSG_CMSG_CLOEXEC);
- #else /* defined(HAVE_PACKET_AUXDATA) && defined(HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI) */
- fromlen = sizeof(from);
- packet_len = recvfrom(
-@@ -1976,7 +1976,7 @@ scan_sys_class_net(pcap_if_t **devlistp,
- /*
- * Create a socket from which to fetch interface information.
- */
-- fd = socket(AF_INET, SOCK_DGRAM, 0);
-+ fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd < 0) {
- (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
-@@ -2122,7 +2122,7 @@ scan_proc_net_dev(pcap_if_t **devlistp,
- /*
- * Create a socket from which to fetch interface information.
- */
-- fd = socket(AF_INET, SOCK_DGRAM, 0);
-+ fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd < 0) {
- (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
-@@ -2919,8 +2919,8 @@ activate_new(pcap_t *handle)
- * try a SOCK_RAW socket for the raw interface.
- */
- sock_fd = is_any_device ?
-- socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL)) :
-- socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
-+ socket(PF_PACKET, SOCK_DGRAM|SOCK_CLOEXEC, htons(ETH_P_ALL)) :
-+ socket(PF_PACKET, SOCK_RAW|SOCK_CLOEXEC, htons(ETH_P_ALL));
-
- if (sock_fd == -1) {
- if (errno == EINVAL || errno == EAFNOSUPPORT) {
-@@ -3036,7 +3036,7 @@ activate_new(pcap_t *handle)
- "close: %s", pcap_strerror(errno));
- return PCAP_ERROR;
- }
-- sock_fd = socket(PF_PACKET, SOCK_DGRAM,
-+ sock_fd = socket(PF_PACKET, SOCK_DGRAM|SOCK_CLOEXEC,
- htons(ETH_P_ALL));
- if (sock_fd == -1) {
- snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
-@@ -5065,7 +5065,7 @@ activate_old(pcap_t *handle)
-
- /* Open the socket */
-
-- handle->fd = socket(PF_INET, SOCK_PACKET, htons(ETH_P_ALL));
-+ handle->fd = socket(PF_INET, SOCK_PACKET|SOCK_CLOEXEC, htons(ETH_P_ALL));
- if (handle->fd == -1) {
- snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
---- configure.in.orig
-+++ configure.in
-@@ -22,7 +22,9 @@ AC_INIT(pcap.c)
- AC_CANONICAL_SYSTEM
-
- AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
--AC_PROG_CC
-+AC_PROG_CC_STDC
-+AC_USE_SYSTEM_EXTENSIONS
-+AC_SYS_LARGEFILE
- AC_LBL_C_INIT(V_CCOPT, V_INCLS)
- AC_LBL_SHLIBS_INIT
- AC_LBL_C_INLINE
---- pcap-canusb-linux.c.orig
-+++ pcap-canusb-linux.c
-@@ -36,6 +36,7 @@
- #include "config.h"
- #endif
-
-+#include <pthread.h>
- #include <libusb-1.0/libusb.h>
-
- #include "pcap-int.h"
-@@ -264,7 +265,7 @@ static int canusb_startcapture(struct ca
- {
- int pipefd[2];
-
-- if (pipe(pipefd) == -1) return -1;
-+ if (pipe2(pipefd, O_CLOEXEC) == -1) return -1;
-
- canusb.rdpipe = pipefd[0];
- canusb.wrpipe = pipefd[1];
---- inet.c.orig
-+++ inet.c
-@@ -430,7 +430,7 @@ add_addr_to_iflist(pcap_if_t **alldevs,
- */
- memset(&ifrdesc, 0, sizeof ifrdesc);
- strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
-- s = socket(AF_INET, SOCK_DGRAM, 0);
-+ s = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (s >= 0) {
- #ifdef __FreeBSD__
- /*
-@@ -745,7 +745,7 @@ pcap_lookupnet(device, netp, maskp, errb
- return 0;
- }
-
-- fd = socket(AF_INET, SOCK_DGRAM, 0);
-+ fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd < 0) {
- (void)snprintf(errbuf, PCAP_ERRBUF_SIZE, "socket: %s",
- pcap_strerror(errno));
---- pcap-netfilter-linux.c.orig
-+++ pcap-netfilter-linux.c
-@@ -363,7 +363,7 @@ nflog_activate(pcap_t* handle)
- handle->stats_op = netfilter_stats_linux;
-
- /* Create netlink socket */
-- handle->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
-+ handle->fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_NETFILTER);
- if (handle->fd < 0) {
- snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't create raw socket %d:%s", errno, pcap_strerror(errno));
- return PCAP_ERROR;
-@@ -450,7 +450,7 @@ netfilter_platform_finddevs(pcap_if_t **
- pcap_if_t *found_dev = *alldevsp;
- int sock;
-
-- sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
-+ sock = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_NETFILTER);
- if (sock < 0) {
- /* if netlink is not supported this is not fatal */
- if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
---- savefile.c.orig
-+++ savefile.c
-@@ -189,7 +189,7 @@ pcap_open_offline(const char *fname, cha
- }
- else {
- #if !defined(WIN32) && !defined(MSDOS)
-- fp = fopen(fname, "r");
-+ fp = fopen(fname, "re");
- #else
- fp = fopen(fname, "rb");
- #endif
---- pcap-snit.c.orig
-+++ pcap-snit.c
-@@ -297,9 +297,9 @@ pcap_activate_snit(pcap_t *p)
- * the device in question) can be indicated at open
- * time.
- */
-- p->fd = fd = open(dev, O_RDWR);
-+ p->fd = fd = open(dev, O_RDWR|O_CLOEXEC);
- if (fd < 0 && errno == EACCES)
-- p->fd = fd = open(dev, O_RDONLY);
-+ p->fd = fd = open(dev, O_RDONLY|O_CLOEXEC);
- if (fd < 0) {
- snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "%s: %s", dev,
- pcap_strerror(errno));
---- fad-glifc.c.orig
-+++ fad-glifc.c
-@@ -100,7 +100,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c
- * Create a socket from which to fetch the list of interfaces,
- * and from which to fetch IPv4 information.
- */
-- fd4 = socket(AF_INET, SOCK_DGRAM, 0);
-+ fd4 = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd4 < 0) {
- (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
-@@ -110,7 +110,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c
- /*
- * Create a socket from which to fetch IPv6 information.
- */
-- fd6 = socket(AF_INET6, SOCK_DGRAM, 0);
-+ fd6 = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd6 < 0) {
- (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
---- pcap-nit.c.orig
-+++ pcap-nit.c
-@@ -259,7 +259,7 @@ pcap_activate_nit(pcap_t *p)
- p->snapshot = 96;
-
- memset(p, 0, sizeof(*p));
-- p->fd = fd = socket(AF_NIT, SOCK_RAW, NITPROTO_RAW);
-+ p->fd = fd = socket(AF_NIT, SOCK_RAW|SOCK_CLOEXEC, NITPROTO_RAW);
- if (fd < 0) {
- snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
---- pcap-sita.c.orig
-+++ pcap-sita.c
-@@ -318,7 +318,7 @@ static int open_with_IOP(unit_t *u, int
- u->serv_addr->sin_addr.s_addr = inet_addr(ip);
- u->serv_addr->sin_port = htons(IOP_SNIFFER_PORT);
-
-- if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
-+ if ((sockfd = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, 0)) < 0) {
- fprintf(stderr, "pcap can't open a socket for connecting to IOP at %s\n", ip);
- return 0;
- }
---- pcap-can-linux.c.orig
-+++ pcap-can-linux.c
-@@ -106,7 +106,7 @@ can_activate(pcap_t* handle)
- handle->stats_op = can_stats_linux;
-
- /* Create socket */
-- handle->fd = socket(PF_CAN, SOCK_RAW, CAN_RAW);
-+ handle->fd = socket(PF_CAN, SOCK_RAW|SOCK_CLOEXEC, CAN_RAW);
- if (handle->fd < 0)
- {
- snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't create raw socket %d:%s",
-@@ -180,7 +180,7 @@ can_read_linux(pcap_t *handle, int max_p
-
- do
- {
-- pkth.caplen = recvmsg(handle->fd, &msg, 0);
-+ pkth.caplen = recvmsg(handle->fd, &msg, MSG_CMSG_CLOEXEC);
- if (handle->break_loop)
- {
- handle->break_loop = 0;
---- fad-gifc.c.orig
-+++ fad-gifc.c
-@@ -156,7 +156,7 @@ pcap_findalldevs(pcap_if_t **alldevsp, c
- /*
- * Create a socket from which to fetch the list of interfaces.
- */
-- fd = socket(AF_INET, SOCK_DGRAM, 0);
-+ fd = socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, 0);
- if (fd < 0) {
- (void)snprintf(errbuf, PCAP_ERRBUF_SIZE,
- "socket: %s", pcap_strerror(errno));
---- nametoaddr.c.orig
-+++ nametoaddr.c
-@@ -440,7 +440,7 @@ pcap_ether_hostton(const char *name)
- static int init = 0;
-
- if (!init) {
-- fp = fopen(PCAP_ETHERS_FILE, "r");
-+ fp = fopen(PCAP_ETHERS_FILE, "re");
- ++init;
- if (fp == NULL)
- return (NULL);
---- pcap-usb-linux.c.orig
-+++ pcap-usb-linux.c
-@@ -252,7 +252,7 @@ probe_devices(int bus)
-
- snprintf(buf, sizeof(buf), "/dev/bus/usb/%03d/%s", bus, data->d_name);
-
-- fd = open(buf, O_RDWR);
-+ fd = open(buf, O_RDWR|O_CLOEXEC);
- if (fd == -1)
- continue;
-
-@@ -323,7 +323,7 @@ usb_activate(pcap_t* handle)
-
- /*now select the read method: try to open binary interface */
- snprintf(full_path, USB_LINE_LEN, LINUX_USB_MON_DEV"%d", handle->md.ifindex);
-- handle->fd = open(full_path, O_RDONLY, 0);
-+ handle->fd = open(full_path, O_RDONLY|O_CLOEXEC, 0);
- if (handle->fd >= 0)
- {
- if (handle->opt.rfmon) {
-@@ -358,7 +358,7 @@ usb_activate(pcap_t* handle)
- else {
- /*Binary interface not available, try open text interface */
- snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR"/%dt", handle->md.ifindex);
-- handle->fd = open(full_path, O_RDONLY, 0);
-+ handle->fd = open(full_path, O_RDONLY|O_CLOEXEC, 0);
- if (handle->fd < 0)
- {
- if (errno == ENOENT)
-@@ -368,7 +368,7 @@ usb_activate(pcap_t* handle)
- * the old location.
- */
- snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%dt", handle->md.ifindex);
-- handle->fd = open(full_path, O_RDONLY, 0);
-+ handle->fd = open(full_path, O_RDONLY|O_CLOEXEC, 0);
- }
- if (handle->fd < 0) {
- /* no more fallback, give it up*/
-@@ -634,7 +634,7 @@ usb_stats_linux(pcap_t *handle, struct p
- int fd;
-
- snprintf(string, USB_LINE_LEN, USB_TEXT_DIR"/%ds", handle->md.ifindex);
-- fd = open(string, O_RDONLY, 0);
-+ fd = open(string, O_RDONLY|O_CLOEXEC, 0);
- if (fd < 0)
- {
- if (errno == ENOENT)
-@@ -644,7 +644,7 @@ usb_stats_linux(pcap_t *handle, struct p
- * location.
- */
- snprintf(string, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%ds", handle->md.ifindex);
-- fd = open(string, O_RDONLY, 0);
-+ fd = open(string, O_RDONLY|O_CLOEXEC, 0);
- }
- if (fd < 0) {
- snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
---- pcap-snoop.c.orig
-+++ pcap-snoop.c
-@@ -205,7 +205,7 @@ pcap_activate_snoop(pcap_t *p)
- int snooplen;
- struct ifreq ifr;
-
-- fd = socket(PF_RAW, SOCK_RAW, RAWPROTO_SNOOP);
-+ fd = socket(PF_RAW, SOCK_RAW|SOCK_CLOEXEC, RAWPROTO_SNOOP);
- if (fd < 0) {
- snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "snoop socket: %s",
- pcap_strerror(errno));
---- pcap-bt-linux.c.orig
-+++ pcap-bt-linux.c
-@@ -79,7 +79,7 @@ bt_platform_finddevs(pcap_if_t **alldevs
- int i, sock;
- int ret = 0;
-
-- sock = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
-+ sock = socket(AF_BLUETOOTH, SOCK_RAW|SOCK_CLOEXEC, BTPROTO_HCI);
- if (sock < 0)
- {
- /* if bluetooth is not supported this this is not fatal*/
-@@ -181,7 +181,7 @@ bt_activate(pcap_t* handle)
- handle->md.ifindex = dev_id;
-
- /* Create HCI socket */
-- handle->fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
-+ handle->fd = socket(AF_BLUETOOTH, SOCK_RAW|SOCK_CLOEXEC, BTPROTO_HCI);
- if (handle->fd < 0) {
- snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
- "Can't create raw socket: %s", strerror(errno));
-@@ -282,7 +282,7 @@ bt_read_linux(pcap_t *handle, int max_pa
-
- /* ignore interrupt system call error */
- do {
-- ret = recvmsg(handle->fd, &msg, 0);
-+ ret = recvmsg(handle->fd, &msg, MSG_CMSG_CLOEXEC);
- if (handle->break_loop)
- {
- handle->break_loop = 0;
diff --git a/packaging/libpcap.spec b/packaging/libpcap.spec
index b56cb56..ffe98ad 100644
--- a/packaging/libpcap.spec
+++ b/packaging/libpcap.spec
@@ -7,11 +7,6 @@ Url: http://www.tcpdump.org/
Group: System/Libraries
Source: %{name}-%{version}.tar.bz2
Source2: baselibs.conf
-Patch0: libpcap-1.0.0-filter-fix.patch
-Patch1: libpcap-1.0.0-pcap-bpf.patch
-Patch2: libpcap-1.0.0-ppp.patch
-Patch3: libpcap-1.0.0-s390.patch
-Patch4: libpcap-ocloexec.patch
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
@@ -36,11 +31,6 @@ program yourself.
%prep
%setup -q
-%patch0
-%patch1
-%patch2
-%patch3
-%patch4
%build
pic="pic"
@@ -51,8 +41,7 @@ export CFLAGS="%{optflags} -f$pic" CXXFLAGS="%{optflags} -f$pic"
make %{?_smp_mflags} all shared
%install
-mkdir -p %{buildroot}%{_bindir}
-make DESTDIR=%{buildroot} install install-shared
+%make_install
%docs_package
diff --git a/packaging/pcap.spec.in b/packaging/pcap.spec.in
deleted file mode 100644
index ff7b996..0000000
--- a/packaging/pcap.spec.in
+++ /dev/null
@@ -1,77 +0,0 @@
-%define prefix /usr
-%define version @VERSION@
-
-Summary: A system-independent interface for user-level packet capture
-Name: libpcap
-Version: %version
-Release: 1
-Group: Development/Libraries
-License: BSD with advertising
-Source: @NAME@.tar.gz
-BuildRoot: /tmp/%{name}-buildroot
-URL: http://www.tcpdump.org
-
-Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz
-
-%description
-Libpcap provides a portable framework for low-level network
-monitoring. Libpcap can provide network statistics collection,
-security monitoring and network debugging. Since almost every system
-vendor provides a different interface for packet capture, the libpcap
-authors created this system-independent API to ease in porting and to
-alleviate the need for several system-dependent packet capture modules
-in each application.
-
-Install libpcap if you need to do low-level network traffic monitoring
-on your network.
-
-%package devel
-Summary: Libraries and header files for the libpcap library
-Group: Development/Libraries
-
-%description devel
-Libpcap provides a portable framework for low-level network
-monitoring. Libpcap can provide network statistics collection,
-security monitoring and network debugging. Since almost every system
-vendor provides a different interface for packet capture, the libpcap
-authors created this system-independent API to ease in porting and to
-alleviate the need for several system-dependent packet capture modules
-in each application.
-
-This package provides the libraries, include files, and other
-resources needed for developing libpcap applications.
-
-%prep
-%setup -q
-
-%build
-export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
-%configure
-make %{?_smp_mflags}
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-make DESTDIR=$RPM_BUILD_ROOT install
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-%doc LICENSE README CHANGES INSTALL.txt README.linux TODO VERSION CREDITS packaging/pcap.spec
-%{_libdir}/libpcap.so.*
-%{_mandir}/man7/pcap*.7*
-
-%files devel
-%defattr(-,root,root)
-%{_bindir}/pcap-config
-%{_includedir}/pcap/*.h
-%{_includedir}/pcap.h
-%{_includedir}/pcap-bpf.h
-%{_includedir}/pcap-namedb.h
-%{_libdir}/libpcap.so
-%{_libdir}/libpcap.a
-%{_mandir}/man1/pcap-config.1*
-%{_mandir}/man3/pcap*.3*
-%{_mandir}/man5/pcap*.5*