Accepting request 454184 from home:pmonrealgonzalez:branches:Base:System
- Formatted the specs file using spec-cleaner. - Allow bluetooth monitoring support unconditionally. - update to 1.8.1 * Clean up the name-to-DLT mapping table. * Add some newer DLT_ values: IPMI_HPM_2,ZWAVE_R1_R2,ZWAVE_R3,WATTSTOPPER_DLM,ISO_14443,RDS * Fix handling of packet count in the TPACKET_V3 inner loop: GitHub issue #493. * Filter out duplicate looped back CAN frames. * Fix the handling of loopback filters for IPv6 packets. * Add a link-layer header type for RDS (IEC 62106) groups. * On Linux, handle all CAN captures with pcap-linux.c, in cooked mode. * Removes the need for the "host-endian" link-layer header type. * Compile with '-Wused-but-marked-unused' in devel mode if supported * Have separate DLTs for big-endian and host-endian SocketCAN headers. * Require that version.h be generated: all build procedures we support generate version.h (autoconf, CMake, MSVC)! * Properly check for sock_recv() errors. * Re-impose some of Winsock's limitations on sock_recv(). * Replace sprintf() with pcap_snprintf(). * Fix signature of pcap_stats_ex_remote(). * Have rpcap_remoteact_getsock() return a SOCKET and supply an "is active" flag. * Clean up {DAG, Septel, Myricom SNF}-only builds. * pcap_create_interface() needs the interface name on Linux. * Clean up hardware time stamp support: the "any" device does not support any time stamp types. * Recognize 802.1ad nested VLAN tag in vlan filter. - dropped libpcap-ocloexec.patch, never upstreamed. - refreshed libpcap-1.0.0-ppp.patch OBS-URL: https://build.opensuse.org/request/show/454184 OBS-URL: https://build.opensuse.org/package/show/Base:System/libpcap?expand=0&rev=52
This commit is contained in:
parent
06013bf785
commit
abe8eda15a
@ -2,11 +2,11 @@ Index: gencode.c
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- gencode.c.orig
|
--- gencode.c.orig
|
||||||
+++ gencode.c
|
+++ gencode.c
|
||||||
@@ -7483,6 +7483,7 @@ gen_inbound(dir)
|
@@ -7549,6 +7549,7 @@ gen_inbound(compiler_state_t *cstate, in
|
||||||
*/
|
*/
|
||||||
switch (linktype) {
|
switch (cstate->linktype) {
|
||||||
case DLT_SLIP:
|
case DLT_SLIP:
|
||||||
+ case DLT_PPP:
|
+ case DLT_PPP:
|
||||||
b0 = gen_relation(BPF_JEQ,
|
b0 = gen_relation(cstate, BPF_JEQ,
|
||||||
gen_load(Q_LINK, gen_loadi(0), 1),
|
gen_load(cstate, Q_LINK, gen_loadi(cstate, 0), 1),
|
||||||
gen_loadi(0),
|
gen_loadi(cstate, 0),
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:dd9f85213dc8e948068405b55dd20f8b32e3083e9e0e186f833bd0372e559e2f
|
|
||||||
size 662941
|
|
Binary file not shown.
3
libpcap-1.8.1.tar.gz
Normal file
3
libpcap-1.8.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e
|
||||||
|
size 739163
|
BIN
libpcap-1.8.1.tar.gz.sig
Normal file
BIN
libpcap-1.8.1.tar.gz.sig
Normal file
Binary file not shown.
@ -1,409 +0,0 @@
|
|||||||
---
|
|
||||||
configure.in | 4 +++-
|
|
||||||
fad-gifc.c | 2 +-
|
|
||||||
fad-glifc.c | 4 ++--
|
|
||||||
inet.c | 4 ++--
|
|
||||||
nametoaddr.c | 2 +-
|
|
||||||
pcap-bt-linux.c | 6 +++---
|
|
||||||
pcap-can-linux.c | 4 ++--
|
|
||||||
pcap-canusb-linux.c | 3 ++-
|
|
||||||
pcap-linux.c | 16 ++++++++--------
|
|
||||||
pcap-netfilter-linux.c | 4 ++--
|
|
||||||
pcap-nit.c | 2 +-
|
|
||||||
pcap-sita.c | 2 +-
|
|
||||||
pcap-snit.c | 4 ++--
|
|
||||||
pcap-snoop.c | 2 +-
|
|
||||||
pcap-usb-linux.c | 12 ++++++------
|
|
||||||
savefile.c | 2 +-
|
|
||||||
sf-pcap.c | 2 +-
|
|
||||||
17 files changed, 39 insertions(+), 36 deletions(-)
|
|
||||||
|
|
||||||
Index: libpcap-1.7.2/configure.in
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/configure.in 2015-03-13 13:05:08.908309397 +0100
|
|
||||||
+++ libpcap-1.7.2/configure.in 2015-03-13 13:05:09.885323892 +0100
|
|
||||||
@@ -20,7 +20,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
|
|
||||||
Index: libpcap-1.7.2/fad-gifc.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/fad-gifc.c 2015-03-13 13:05:08.908309397 +0100
|
|
||||||
+++ libpcap-1.7.2/fad-gifc.c 2015-03-13 13:05:09.885323892 +0100
|
|
||||||
@@ -152,7 +152,7 @@ pcap_findalldevs_interfaces(pcap_if_t **
|
|
||||||
/*
|
|
||||||
* 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));
|
|
||||||
Index: libpcap-1.7.2/fad-glifc.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/fad-glifc.c 2015-03-13 13:05:08.908309397 +0100
|
|
||||||
+++ libpcap-1.7.2/fad-glifc.c 2015-03-13 13:05:09.885323892 +0100
|
|
||||||
@@ -95,7 +95,7 @@ pcap_findalldevs_interfaces(pcap_if_t **
|
|
||||||
* 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));
|
|
||||||
@@ -105,7 +105,7 @@ pcap_findalldevs_interfaces(pcap_if_t **
|
|
||||||
/*
|
|
||||||
* 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));
|
|
||||||
Index: libpcap-1.7.2/inet.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/inet.c 2015-03-13 13:05:08.909309412 +0100
|
|
||||||
+++ libpcap-1.7.2/inet.c 2015-03-13 13:05:09.886323907 +0100
|
|
||||||
@@ -506,7 +506,7 @@ get_if_description(const char *name)
|
|
||||||
*/
|
|
||||||
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__
|
|
||||||
/*
|
|
||||||
@@ -913,7 +913,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));
|
|
||||||
Index: libpcap-1.7.2/nametoaddr.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/nametoaddr.c 2015-03-13 13:05:08.909309412 +0100
|
|
||||||
+++ libpcap-1.7.2/nametoaddr.c 2015-03-13 13:05:09.886323907 +0100
|
|
||||||
@@ -438,7 +438,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);
|
|
||||||
Index: libpcap-1.7.2/pcap-bt-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-bt-linux.c 2015-03-13 13:05:08.909309412 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-bt-linux.c 2015-03-13 13:05:09.886323907 +0100
|
|
||||||
@@ -81,7 +81,7 @@ bt_findalldevs(pcap_if_t **alldevsp, cha
|
|
||||||
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*/
|
|
||||||
@@ -214,7 +214,7 @@ bt_activate(pcap_t* handle)
|
|
||||||
handlep->dev_id = 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));
|
|
||||||
@@ -318,7 +318,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;
|
|
||||||
Index: libpcap-1.7.2/pcap-can-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-can-linux.c 2015-03-13 13:05:08.909309412 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-can-linux.c 2015-03-13 13:05:09.886323907 +0100
|
|
||||||
@@ -161,7 +161,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",
|
|
||||||
@@ -235,7 +235,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;
|
|
||||||
Index: libpcap-1.7.2/pcap-canusb-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-canusb-linux.c 2015-03-13 13:05:08.910309427 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-canusb-linux.c 2015-03-13 13:05:09.887323922 +0100
|
|
||||||
@@ -36,6 +36,7 @@
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#include <pthread.h>
|
|
||||||
#include <libusb-1.0/libusb.h>
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
@@ -291,7 +292,7 @@ static int canusb_startcapture(struct pc
|
|
||||||
{
|
|
||||||
int pipefd[2];
|
|
||||||
|
|
||||||
- if (pipe(pipefd) == -1)
|
|
||||||
+ if (pipe2(pipefd, O_CLOEXEC) == -1)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
this->rdpipe = pipefd[0];
|
|
||||||
Index: libpcap-1.7.2/pcap-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-linux.c 2015-03-13 13:05:08.913309471 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-linux.c 2015-03-13 13:05:09.888323937 +0100
|
|
||||||
@@ -985,7 +985,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));
|
|
||||||
@@ -1580,7 +1580,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(
|
|
||||||
@@ -2144,7 +2144,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));
|
|
||||||
@@ -2262,7 +2262,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));
|
|
||||||
@@ -3133,8 +3133,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) {
|
|
||||||
@@ -3251,7 +3251,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,
|
|
||||||
@@ -6022,7 +6022,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));
|
|
||||||
Index: libpcap-1.7.2/pcap-netfilter-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-netfilter-linux.c 2015-03-13 13:05:08.913309471 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-netfilter-linux.c 2015-03-13 13:06:27.048468585 +0100
|
|
||||||
@@ -489,7 +489,7 @@ netfilter_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;
|
|
||||||
@@ -636,7 +636,7 @@ netfilter_findalldevs(pcap_if_t **alldev
|
|
||||||
{
|
|
||||||
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)
|
|
||||||
Index: libpcap-1.7.2/pcap-nit.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-nit.c 2015-03-13 13:05:08.913309471 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-nit.c 2015-03-13 13:05:09.888323937 +0100
|
|
||||||
@@ -278,7 +278,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));
|
|
||||||
Index: libpcap-1.7.2/pcap-sita.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-sita.c 2015-03-13 13:05:08.914309486 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-sita.c 2015-03-13 13:05:09.889323952 +0100
|
|
||||||
@@ -324,7 +324,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;
|
|
||||||
}
|
|
||||||
Index: libpcap-1.7.2/pcap-snit.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-snit.c 2015-03-13 13:05:08.914309486 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-snit.c 2015-03-13 13:05:09.889323952 +0100
|
|
||||||
@@ -316,9 +316,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));
|
|
||||||
Index: libpcap-1.7.2/pcap-snoop.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-snoop.c 2015-03-13 13:05:08.914309486 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-snoop.c 2015-03-13 13:05:09.889323952 +0100
|
|
||||||
@@ -210,7 +210,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));
|
|
||||||
Index: libpcap-1.7.2/pcap-usb-linux.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/pcap-usb-linux.c 2015-03-13 13:05:08.915309501 +0100
|
|
||||||
+++ libpcap-1.7.2/pcap-usb-linux.c 2015-03-13 13:07:28.072373687 +0100
|
|
||||||
@@ -261,7 +261,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;
|
|
||||||
|
|
||||||
@@ -364,7 +364,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", handlep->bus_index);
|
|
||||||
- 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) {
|
|
||||||
@@ -403,7 +403,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", handlep->bus_index);
|
|
||||||
- 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)
|
|
||||||
@@ -413,7 +413,7 @@ usb_activate(pcap_t* handle)
|
|
||||||
* the old location.
|
|
||||||
*/
|
|
||||||
snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%dt", handlep->bus_index);
|
|
||||||
- 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*/
|
|
||||||
@@ -681,7 +681,7 @@ usb_stats_linux(pcap_t *handle, struct p
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
snprintf(string, USB_LINE_LEN, USB_TEXT_DIR"/%ds", handlep->bus_index);
|
|
||||||
- fd = open(string, O_RDONLY, 0);
|
|
||||||
+ fd = open(string, O_RDONLY|O_CLOEXEC, 0);
|
|
||||||
if (fd < 0)
|
|
||||||
{
|
|
||||||
if (errno == ENOENT)
|
|
||||||
@@ -691,7 +691,7 @@ usb_stats_linux(pcap_t *handle, struct p
|
|
||||||
* location.
|
|
||||||
*/
|
|
||||||
snprintf(string, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%ds", handlep->bus_index);
|
|
||||||
- fd = open(string, O_RDONLY, 0);
|
|
||||||
+ fd = open(string, O_RDONLY|O_CLOEXEC, 0);
|
|
||||||
}
|
|
||||||
if (fd < 0) {
|
|
||||||
snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
|
|
||||||
Index: libpcap-1.7.2/savefile.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/savefile.c 2015-03-13 13:05:08.915309501 +0100
|
|
||||||
+++ libpcap-1.7.2/savefile.c 2015-03-13 13:05:09.890323967 +0100
|
|
||||||
@@ -185,7 +185,7 @@ pcap_open_offline_with_tstamp_precision(
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#if !defined(WIN32) && !defined(MSDOS)
|
|
||||||
- fp = fopen(fname, "r");
|
|
||||||
+ fp = fopen(fname, "re");
|
|
||||||
#else
|
|
||||||
fp = fopen(fname, "rb");
|
|
||||||
#endif
|
|
||||||
Index: libpcap-1.7.2/sf-pcap.c
|
|
||||||
===================================================================
|
|
||||||
--- libpcap-1.7.2.orig/sf-pcap.c 2015-03-13 13:05:08.915309501 +0100
|
|
||||||
+++ libpcap-1.7.2/sf-pcap.c 2015-03-13 13:05:09.890323967 +0100
|
|
||||||
@@ -664,7 +664,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
|
|
@ -1,3 +1,42 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 2 13:37:19 UTC 2017 - pmonrealgonzalez@suse.com
|
||||||
|
|
||||||
|
- Formatted the specs file using spec-cleaner.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 2 13:28:11 UTC 2017 - pmonrealgonzalez@suse.com
|
||||||
|
|
||||||
|
- Allow bluetooth monitoring support unconditionally.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 2 13:09:23 UTC 2017 - pmonrealgonzalez@suse.com
|
||||||
|
|
||||||
|
- update to 1.8.1
|
||||||
|
* Clean up the name-to-DLT mapping table.
|
||||||
|
* Add some newer DLT_ values:
|
||||||
|
IPMI_HPM_2,ZWAVE_R1_R2,ZWAVE_R3,WATTSTOPPER_DLM,ISO_14443,RDS
|
||||||
|
* Fix handling of packet count in the TPACKET_V3 inner loop: GitHub issue
|
||||||
|
#493.
|
||||||
|
* Filter out duplicate looped back CAN frames.
|
||||||
|
* Fix the handling of loopback filters for IPv6 packets.
|
||||||
|
* Add a link-layer header type for RDS (IEC 62106) groups.
|
||||||
|
* On Linux, handle all CAN captures with pcap-linux.c, in cooked mode.
|
||||||
|
* Removes the need for the "host-endian" link-layer header type.
|
||||||
|
* Compile with '-Wused-but-marked-unused' in devel mode if supported
|
||||||
|
* Have separate DLTs for big-endian and host-endian SocketCAN headers.
|
||||||
|
* Require that version.h be generated: all build procedures we support generate version.h (autoconf, CMake, MSVC)!
|
||||||
|
* Properly check for sock_recv() errors.
|
||||||
|
* Re-impose some of Winsock's limitations on sock_recv().
|
||||||
|
* Replace sprintf() with pcap_snprintf().
|
||||||
|
* Fix signature of pcap_stats_ex_remote().
|
||||||
|
* Have rpcap_remoteact_getsock() return a SOCKET and supply an "is active" flag.
|
||||||
|
* Clean up {DAG, Septel, Myricom SNF}-only builds.
|
||||||
|
* pcap_create_interface() needs the interface name on Linux.
|
||||||
|
* Clean up hardware time stamp support: the "any" device does not support any time stamp types.
|
||||||
|
* Recognize 802.1ad nested VLAN tag in vlan filter.
|
||||||
|
- dropped libpcap-ocloexec.patch, never upstreamed.
|
||||||
|
- refreshed libpcap-1.0.0-ppp.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Apr 17 02:42:52 UTC 2016 - crrodriguez@opensuse.org
|
Sun Apr 17 02:42:52 UTC 2016 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
|
35
libpcap.spec
35
libpcap.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package libpcap
|
# spec file for package libpcap
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -16,11 +16,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# bluetooth not working with bluez 5.21
|
|
||||||
%bcond_with bluetooth
|
|
||||||
|
|
||||||
Name: libpcap
|
Name: libpcap
|
||||||
Version: 1.7.3
|
Version: 1.8.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A Library for Network Sniffers
|
Summary: A Library for Network Sniffers
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
@ -34,18 +31,15 @@ Patch0: libpcap-1.5.2-filter-fix.patch
|
|||||||
Patch1: libpcap-1.0.0-pcap-bpf.patch
|
Patch1: libpcap-1.0.0-pcap-bpf.patch
|
||||||
Patch2: libpcap-1.0.0-ppp.patch
|
Patch2: libpcap-1.0.0-ppp.patch
|
||||||
Patch3: libpcap-1.0.0-s390.patch
|
Patch3: libpcap-1.0.0-s390.patch
|
||||||
Patch4: libpcap-ocloexec.patch
|
|
||||||
Patch5: libpcap-no-old-socket.patch
|
Patch5: libpcap-no-old-socket.patch
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
|
BuildRequires: bluez-devel
|
||||||
BuildRequires: dbus-1-devel
|
BuildRequires: dbus-1-devel
|
||||||
BuildRequires: flex
|
BuildRequires: flex
|
||||||
BuildRequires: libnl3-devel
|
BuildRequires: libnl3-devel
|
||||||
BuildRequires: pkg-config
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: pkgconfig(libusb-1.0)
|
BuildRequires: pkgconfig(libusb-1.0)
|
||||||
%if %{with bluetooth}
|
|
||||||
BuildRequires: bluez-devel
|
|
||||||
%endif
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -57,10 +51,6 @@ program yourself.
|
|||||||
%package -n libpcap1
|
%package -n libpcap1
|
||||||
Summary: A Library for Network Sniffers
|
Summary: A Library for Network Sniffers
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
# bug437293
|
|
||||||
%ifarch ppc64
|
|
||||||
Obsoletes: libpcap-64bit
|
|
||||||
%endif
|
|
||||||
#
|
#
|
||||||
%if 0%{?suse_version} > 1100
|
%if 0%{?suse_version} > 1100
|
||||||
Provides: libpcap = %{version}
|
Provides: libpcap = %{version}
|
||||||
@ -89,12 +79,10 @@ program yourself.
|
|||||||
Summary: A Library for Network Sniffers
|
Summary: A Library for Network Sniffers
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: %{name}-devel = %{version}
|
Requires: %{name}-devel = %{version}
|
||||||
|
Requires: bluez-devel
|
||||||
Requires: dbus-1-devel
|
Requires: dbus-1-devel
|
||||||
Requires: libnl3-devel
|
Requires: libnl3-devel
|
||||||
Requires: pkgconfig(libusb-1.0)
|
Requires: pkgconfig(libusb-1.0)
|
||||||
%if %{with bluetooth}
|
|
||||||
Requires: bluez-devel
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description devel-static
|
%description devel-static
|
||||||
libpcap static libraries
|
libpcap static libraries
|
||||||
@ -105,10 +93,10 @@ libpcap static libraries
|
|||||||
%patch1
|
%patch1
|
||||||
%patch2
|
%patch2
|
||||||
%patch3
|
%patch3
|
||||||
%patch4 -p1
|
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ifarch %sparc
|
%ifarch %{sparc}
|
||||||
pic="PIC"
|
pic="PIC"
|
||||||
%else
|
%else
|
||||||
pic="pic"
|
pic="pic"
|
||||||
@ -116,11 +104,7 @@ pic="pic"
|
|||||||
autoreconf -fiv
|
autoreconf -fiv
|
||||||
export CFLAGS="%{optflags} -f$pic" CXXFLAGS="%{optflags} -f$pic"
|
export CFLAGS="%{optflags} -f$pic" CXXFLAGS="%{optflags} -f$pic"
|
||||||
%configure \
|
%configure \
|
||||||
%if %{with bluetooth}
|
|
||||||
--enable-bluetooth=yes \
|
--enable-bluetooth=yes \
|
||||||
%else
|
|
||||||
--enable-bluetooth=no \
|
|
||||||
%endif
|
|
||||||
--enable-ipv6
|
--enable-ipv6
|
||||||
make %{?_smp_mflags} all shared
|
make %{?_smp_mflags} all shared
|
||||||
|
|
||||||
@ -129,14 +113,13 @@ mkdir -p %{buildroot}%{_bindir}
|
|||||||
make DESTDIR=%{buildroot} install install-shared
|
make DESTDIR=%{buildroot} install install-shared
|
||||||
|
|
||||||
%post -n libpcap1 -p /sbin/ldconfig
|
%post -n libpcap1 -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -n libpcap1 -p /sbin/ldconfig
|
%postun -n libpcap1 -p /sbin/ldconfig
|
||||||
|
|
||||||
%files -n libpcap1
|
%files -n libpcap1
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc CHANGES CREDITS LICENSE README README.linux TODO
|
%doc CHANGES CREDITS LICENSE README README.linux TODO
|
||||||
%{_libdir}/*.so.*
|
%{_libdir}/*.so.*
|
||||||
%doc %{_mandir}/man7/*
|
%{_mandir}/man7/*
|
||||||
|
|
||||||
%files devel-static
|
%files devel-static
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
@ -144,7 +127,7 @@ make DESTDIR=%{buildroot} install install-shared
|
|||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%doc %{_mandir}/man[1-6]/*
|
%{_mandir}/man[1-6]/*
|
||||||
%{_includedir}/*
|
%{_includedir}/*
|
||||||
%{_bindir}/pcap-config
|
%{_bindir}/pcap-config
|
||||||
%{_libdir}/*.so
|
%{_libdir}/*.so
|
||||||
|
Loading…
x
Reference in New Issue
Block a user