mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
tcpdump: bump to 4.99.1 (#6361)
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
From a76a010bfed94b17f03385312e1821d4323866e7 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Tue, 28 Apr 2015 20:22:20 +0000
|
||||
Subject: Haiku patch
|
||||
|
||||
|
||||
diff --git a/aclocal.m4 b/aclocal.m4
|
||||
index ca78a02..5dbb773 100644
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -1128,7 +1128,7 @@ AC_DEFUN(AC_LBL_LIBRARY_NET, [
|
||||
AC_CHECK_LIB(socket, gethostbyname,
|
||||
LIBS="-lsocket -lnsl $LIBS", , -lnsl)
|
||||
fi
|
||||
- AC_SEARCH_LIBS(socket, socket, ,
|
||||
+ AC_SEARCH_LIBS(socket, socket network, ,
|
||||
AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))
|
||||
# DLPI needs putmsg under HPUX so test for -lstr while we're at it
|
||||
AC_SEARCH_LIBS(putmsg, str)
|
||||
diff --git a/tcpdump.c b/tcpdump.c
|
||||
index 5598ec2..388697c 100644
|
||||
--- a/tcpdump.c
|
||||
+++ b/tcpdump.c
|
||||
@@ -2007,11 +2007,13 @@ compress_savefile(const char *filename)
|
||||
* Child process.
|
||||
* Set to lowest priority so that this doesn't disturb the capture.
|
||||
*/
|
||||
+#ifndef __HAIKU__
|
||||
#ifdef NZERO
|
||||
setpriority(PRIO_PROCESS, 0, NZERO - 1);
|
||||
#else
|
||||
setpriority(PRIO_PROCESS, 0, 19);
|
||||
#endif
|
||||
+#endif
|
||||
if (execlp(zflag, zflag, filename, (char *)NULL) == -1)
|
||||
fprintf(stderr,
|
||||
"compress_savefile: execlp(%s, %s) failed: %s\n",
|
||||
--
|
||||
2.7.0
|
||||
|
||||
189
net-analyzer/tcpdump/patches/tcpdump-4.99.1.gcc2.patchset
Normal file
189
net-analyzer/tcpdump/patches/tcpdump-4.99.1.gcc2.patchset
Normal file
@@ -0,0 +1,189 @@
|
||||
From 429ca8b7b35b724c8e9690f00eaa76638d9442fb Mon Sep 17 00:00:00 2001
|
||||
From: David Karoly <david.karoly@outlook.com>
|
||||
Date: Mon, 1 Nov 2021 11:06:20 +0100
|
||||
Subject: fix build with gcc2
|
||||
|
||||
|
||||
diff --git a/print-ether.c b/print-ether.c
|
||||
index da95862..6682678 100644
|
||||
--- a/print-ether.c
|
||||
+++ b/print-ether.c
|
||||
@@ -210,6 +210,7 @@ recurse:
|
||||
*/
|
||||
printed_length = 0;
|
||||
if (length_type == ETHERTYPE_MACSEC) {
|
||||
+ int ret;
|
||||
/*
|
||||
* MACsec, aka IEEE 802.1AE-2006
|
||||
* Print the header, and try to print the payload if it's not encrypted
|
||||
@@ -220,7 +221,7 @@ recurse:
|
||||
printed_length = 1;
|
||||
}
|
||||
|
||||
- int ret = macsec_print(ndo, &p, &length, &caplen, &hdrlen,
|
||||
+ ret = macsec_print(ndo, &p, &length, &caplen, &hdrlen,
|
||||
&src, &dst);
|
||||
|
||||
if (ret == 0) {
|
||||
@@ -345,6 +346,7 @@ recurse:
|
||||
}
|
||||
hdrlen += llc_hdrlen;
|
||||
} else if (length_type == ETHERTYPE_ARISTA) {
|
||||
+ int bytesConsumed;
|
||||
if (caplen < 2) {
|
||||
ND_PRINT("[|arista]");
|
||||
return hdrlen + caplen;
|
||||
@@ -355,7 +357,7 @@ recurse:
|
||||
}
|
||||
ether_type_print(ndo, length_type);
|
||||
ND_PRINT(", length %u: ", orig_length);
|
||||
- int bytesConsumed = arista_ethertype_print(ndo, p, length);
|
||||
+ bytesConsumed = arista_ethertype_print(ndo, p, length);
|
||||
if (bytesConsumed > 0) {
|
||||
p += bytesConsumed;
|
||||
length -= bytesConsumed;
|
||||
diff --git a/print-isoclns.c b/print-isoclns.c
|
||||
index ddd5595..2ad598d 100644
|
||||
--- a/print-isoclns.c
|
||||
+++ b/print-isoclns.c
|
||||
@@ -2183,12 +2183,14 @@ isis_print_ext_is_reach(netdissect_options *ndo,
|
||||
break;
|
||||
case ISIS_SUBTLV_EXT_IS_REACH_LAN_ADJ_SEGMENT_ID:
|
||||
if (subtlv_len >= 8) {
|
||||
+ int vflag;
|
||||
+ int lflag;
|
||||
ND_PRINT("%s Flags: [%s]", ident,
|
||||
bittok2str(isis_lan_adj_sid_flag_values,
|
||||
"none",
|
||||
GET_U_1(tptr)));
|
||||
- int vflag = (GET_U_1(tptr) & 0x20) ? 1:0;
|
||||
- int lflag = (GET_U_1(tptr) & 0x10) ? 1:0;
|
||||
+ vflag = (GET_U_1(tptr) & 0x20) ? 1:0;
|
||||
+ lflag = (GET_U_1(tptr) & 0x10) ? 1:0;
|
||||
tptr++;
|
||||
subtlv_len--;
|
||||
subtlv_sum_len--;
|
||||
diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c
|
||||
index 1d7f247..67f537a 100644
|
||||
--- a/print-openflow-1.0.c
|
||||
+++ b/print-openflow-1.0.c
|
||||
@@ -1008,6 +1008,7 @@ static void
|
||||
of10_packet_data_print(netdissect_options *ndo,
|
||||
const u_char *cp, const u_int len)
|
||||
{
|
||||
+ u_char *snapend_save;
|
||||
if (len == 0)
|
||||
return;
|
||||
/* data */
|
||||
@@ -1026,7 +1027,7 @@ of10_packet_data_print(netdissect_options *ndo,
|
||||
* what ether_print() needs to decode an Ethernet frame nested in
|
||||
* the middle of a TCP payload.
|
||||
*/
|
||||
- const u_char *snapend_save = ndo->ndo_snapend;
|
||||
+ snapend_save = ndo->ndo_snapend;
|
||||
ndo->ndo_snapend = ND_MIN(cp + len, ndo->ndo_snapend);
|
||||
ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL);
|
||||
ndo->ndo_snapend = snapend_save;
|
||||
diff --git a/print-ospf.c b/print-ospf.c
|
||||
index c370bda..916b279 100644
|
||||
--- a/print-ospf.c
|
||||
+++ b/print-ospf.c
|
||||
@@ -643,14 +643,15 @@ ospf_print_lsa(netdissect_options *ndo,
|
||||
|
||||
switch (GET_U_1(lsap->ls_hdr.ls_type)) {
|
||||
|
||||
- case LS_TYPE_ROUTER:
|
||||
+ case LS_TYPE_ROUTER: {
|
||||
+ u_int i;
|
||||
ND_PRINT("\n\t Router LSA Options: [%s]",
|
||||
bittok2str(ospf_rla_flag_values, "none", GET_U_1(lsap->lsa_un.un_rla.rla_flags)));
|
||||
|
||||
rla_count = GET_BE_U_2(lsap->lsa_un.un_rla.rla_count);
|
||||
ND_TCHECK_SIZE(lsap->lsa_un.un_rla.rla_link);
|
||||
rlp = lsap->lsa_un.un_rla.rla_link;
|
||||
- for (u_int i = rla_count; i != 0; i--) {
|
||||
+ for (i = rla_count; i != 0; i--) {
|
||||
ND_TCHECK_SIZE(rlp);
|
||||
switch (GET_U_1(rlp->un_tos.link.link_type)) {
|
||||
|
||||
@@ -690,7 +691,7 @@ ospf_print_lsa(netdissect_options *ndo,
|
||||
(GET_U_1(rlp->un_tos.link.link_tos_count) * sizeof(union un_tos)));
|
||||
}
|
||||
break;
|
||||
-
|
||||
+ }
|
||||
case LS_TYPE_NETWORK:
|
||||
ND_PRINT("\n\t Mask %s\n\t Connected Routers:",
|
||||
GET_IPADDR_STRING(lsap->lsa_un.un_nla.nla_mask));
|
||||
@@ -799,10 +800,11 @@ ospf_print_lsa(netdissect_options *ndo,
|
||||
case LS_TYPE_OPAQUE_DW:
|
||||
|
||||
switch (GET_U_1(lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) {
|
||||
- case LS_OPAQUE_TYPE_RI:
|
||||
+ case LS_OPAQUE_TYPE_RI: {
|
||||
+ u_int ls_length_remaining;
|
||||
tptr = (const uint8_t *)(lsap->lsa_un.un_ri_tlv);
|
||||
|
||||
- u_int ls_length_remaining = ls_length;
|
||||
+ ls_length_remaining = ls_length;
|
||||
while (ls_length_remaining != 0) {
|
||||
ND_TCHECK_4(tptr);
|
||||
if (ls_length_remaining < 4) {
|
||||
@@ -847,7 +849,7 @@ ospf_print_lsa(netdissect_options *ndo,
|
||||
ls_length_remaining-=tlv_length;
|
||||
}
|
||||
break;
|
||||
-
|
||||
+ }
|
||||
case LS_OPAQUE_TYPE_GRACE:
|
||||
if (ospf_grace_lsa_print(ndo, (const u_char *)(lsap->lsa_un.un_grace_tlv),
|
||||
ls_length) == -1) {
|
||||
diff --git a/print-rsvp.c b/print-rsvp.c
|
||||
index 23b6d5a..c52ca43 100644
|
||||
--- a/print-rsvp.c
|
||||
+++ b/print-rsvp.c
|
||||
@@ -1191,10 +1191,11 @@ rsvp_obj_print(netdissect_options *ndo,
|
||||
|
||||
case RSVP_OBJ_CAPABILITY:
|
||||
switch(rsvp_obj_ctype) {
|
||||
- case RSVP_CTYPE_1:
|
||||
+ case RSVP_CTYPE_1: {
|
||||
+ uint32_t unused_and_flags;
|
||||
if (obj_tlen < 4)
|
||||
goto obj_tooshort;
|
||||
- uint32_t unused_and_flags = GET_BE_U_4(obj_tptr);
|
||||
+ unused_and_flags = GET_BE_U_4(obj_tptr);
|
||||
if (unused_and_flags & ~RSVP_OBJ_CAPABILITY_FLAGS_MASK)
|
||||
ND_PRINT("%s [reserved=0x%08x must be zero]", indent,
|
||||
unused_and_flags & ~RSVP_OBJ_CAPABILITY_FLAGS_MASK);
|
||||
@@ -1206,6 +1207,7 @@ rsvp_obj_print(netdissect_options *ndo,
|
||||
obj_tlen-=4;
|
||||
obj_tptr+=4;
|
||||
break;
|
||||
+ }
|
||||
default:
|
||||
hexdump=TRUE;
|
||||
}
|
||||
diff --git a/print.c b/print.c
|
||||
index bfc35d9..b4709bf 100644
|
||||
--- a/print.c
|
||||
+++ b/print.c
|
||||
@@ -327,6 +327,7 @@ void
|
||||
pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h,
|
||||
const u_char *sp, u_int packets_captured)
|
||||
{
|
||||
+ struct timeval tvbuf;
|
||||
u_int hdrlen = 0;
|
||||
int invalid_header = 0;
|
||||
|
||||
@@ -392,7 +393,6 @@ pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h,
|
||||
* /usr/include/net/bpf.h and uses 32-bit unsigned types instead of
|
||||
* the types used in struct timeval.
|
||||
*/
|
||||
- struct timeval tvbuf;
|
||||
tvbuf.tv_sec = h->ts.tv_sec;
|
||||
tvbuf.tv_usec = h->ts.tv_usec;
|
||||
ts_print(ndo, &tvbuf);
|
||||
--
|
||||
2.30.2
|
||||
|
||||
22
net-analyzer/tcpdump/patches/tcpdump-4.99.1.patchset
Normal file
22
net-analyzer/tcpdump/patches/tcpdump-4.99.1.patchset
Normal file
@@ -0,0 +1,22 @@
|
||||
From 5fc466d76d9e5f599f9a3c2ae0aade7eece6d486 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Tue, 28 Apr 2015 20:22:20 +0000
|
||||
Subject: Haiku patch
|
||||
|
||||
|
||||
diff --git a/aclocal.m4 b/aclocal.m4
|
||||
index ef5efe0..a618dcd 100644
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -1072,7 +1072,7 @@ AC_DEFUN(AC_LBL_LIBRARY_NET, [
|
||||
AC_CHECK_LIB(socket, gethostbyname,
|
||||
LIBS="-lsocket -lnsl $LIBS", , -lnsl)
|
||||
fi
|
||||
- AC_SEARCH_LIBS(socket, socket, ,
|
||||
+ AC_SEARCH_LIBS(socket, socket network, ,
|
||||
AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))
|
||||
# DLPI needs putmsg under HPUX so test for -lstr while we're at it
|
||||
AC_SEARCH_LIBS(putmsg, str)
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -34,9 +34,13 @@ COPYRIGHT="
|
||||
LICENSE="BSD (3-clause)"
|
||||
REVISION="1"
|
||||
SOURCE_URI="http://www.tcpdump.org/release/tcpdump-${portVersion}.tar.gz"
|
||||
CHECKSUM_SHA256="798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79"
|
||||
CHECKSUM_SHA256="79b36985fb2703146618d87c4acde3e068b91c553fb93f021a337f175fd10ebe"
|
||||
PATCHES="tcpdump-$portVersion.patchset"
|
||||
|
||||
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
|
||||
PATCHES="tcpdump-$portVersion.gcc2.patchset"
|
||||
fi
|
||||
|
||||
ARCHITECTURES="all"
|
||||
|
||||
PROVIDES="
|
||||
@@ -65,7 +69,7 @@ BUILD()
|
||||
{
|
||||
autoreconf -fi
|
||||
runConfigure ./configure
|
||||
make
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
Reference in New Issue
Block a user