pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/lsof various fixes including support for netb...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9089ed92975e
branches: trunk
changeset: 391718:9089ed92975e
user: mrg <mrg%pkgsrc.org@localhost>
date: Fri Jan 13 04:33:17 2023 +0000
description:
various fixes including support for netbsd-10.
- move the "don't know picking 1.6" match to be "1.*" from "1*".
- add 9.99.10[45678], netbsd 9.99, netbsd 10, and netbsd 10.99
support to configure match.
- make netbsd 10.x the "i don't know default" now.
- port the netbsd dsock.c code to the merged inpcb code since
http://mail-index.netbsd.org/source-changes/2022/10/28/msg141800.html
i haven't bumped the pkg because nothing really changed for the
pre-9.99.104 systems, and 9.99.104 and newer haven't built since.
diffstat:
sysutils/lsof/distinfo | 5 +-
sysutils/lsof/patches/patch-ag | 44 ++++++-
sysutils/lsof/patches/patch-dialects_n+obsd_dsock.c | 107 ++++++++++++++++++++
3 files changed, 144 insertions(+), 12 deletions(-)
diffs (225 lines):
diff -r eff109edc0cf -r 9089ed92975e sysutils/lsof/distinfo
--- a/sysutils/lsof/distinfo Thu Jan 12 23:08:49 2023 +0000
+++ b/sysutils/lsof/distinfo Fri Jan 13 04:33:17 2023 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.102 2022/05/25 09:33:37 tnn Exp $
+$NetBSD: distinfo,v 1.103 2023/01/13 04:33:17 mrg Exp $
BLAKE2s (lsof_4.91.tar.bz2) = 77109e036c36f7d1483e69f2aae2314830dc4d2bdc3bf88a4031832f17e6afef
SHA512 (lsof_4.91.tar.bz2) = 49f811941dd6303f7cb0655fddb8b1177af5d1b18f2bd1edfab09d2c128aea73daecf09c7a5375979c66ba764c88a6e70c9086b55c3634e3be01ab1aa12e9f92
@@ -9,7 +9,8 @@
SHA1 (patch-ad) = 7f639e8832c2da8e498c33a38ecbc7b3d3a7430a
SHA1 (patch-ae) = 3f4a7ce54c0646941fd86400f91a2d17e9d2354a
SHA1 (patch-af) = 88b3d2b42c05e20c189fa00fd65f1f412fe54038
-SHA1 (patch-ag) = 99ab1c616604e9775522dbc70bfd6a7294964d0a
+SHA1 (patch-ag) = 198c430f411b0f4b2cb35a9ad12521a97f0edeb9
SHA1 (patch-ah) = 2de22b9a3733f958298af5e33b66c0653c320f59
SHA1 (patch-dialects_n+obsd_dnode1.c) = dc8c766760aca4eb2e7d7af3944260dd49795c09
+SHA1 (patch-dialects_n+obsd_dsock.c) = dadbb0196024c12f59d77b838917036bf90a4e35
SHA1 (patch-lib_Makefile.skel) = abfb9d50eef60c5d43cbf4978bf179de0ebe371e
diff -r eff109edc0cf -r 9089ed92975e sysutils/lsof/patches/patch-ag
--- a/sysutils/lsof/patches/patch-ag Thu Jan 12 23:08:49 2023 +0000
+++ b/sysutils/lsof/patches/patch-ag Fri Jan 13 04:33:17 2023 +0000
@@ -1,8 +1,20 @@
-$NetBSD: patch-ag,v 1.11 2021/11/11 00:49:34 gutteridge Exp $
+$NetBSD: patch-ag,v 1.12 2023/01/13 04:33:17 mrg Exp $
+
+Handle newer NetBSD versions. Default to NetBSD 10 if we can't guess,
+not NetBSD 1.6.
---- Configure.orig 2018-02-14 14:18:55.000000000 +0000
-+++ Configure
-@@ -3077,32 +3077,78 @@ return(0); }
+--- Configure.orig 2018-02-14 06:18:55.000000000 -0800
++++ Configure 2023-01-12 15:52:55.813217146 -0800
+@@ -3038,7 +3038,7 @@
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="1006000"
+ ;;
+- 1*)
++ 1.*)
+ LSOF_VERS="1006000"
+ echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR"
+ echo "!!!WARNING!!! Configuring for NetBSD 1.6"
+@@ -3077,32 +3077,90 @@
echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR"
echo "!!!WARNING!!! Configuring for NetBSD 3.0"
;;
@@ -60,16 +72,28 @@
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="9000000"
+ ;;
++ 9.99.10[45678])
++ LSOF_TSTBIGF=" "
++ LSOF_VERS="9099104"
++ ;;
+ 9.99.*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS="9099000"
+ ;;
++ 10.99.*)
++ LSOF_TSTBIGF=" "
++ LSOF_VERS="10099000"
++ ;;
++ 10.*.*)
++ LSOF_TSTBIGF=" "
++ LSOF_VERS="10000000"
++ ;;
*)
echo "Unknown NetBSD release: $LSOF_VSTR"
- echo Assuming NetBSD 1.6
- LSOF_VERS="1006000"
-+ echo Assuming NetBSD 9.0
-+ LSOF_VERS="9000000"
++ echo Assuming NetBSD 10.0
++ LSOF_VERS="10000000"
;;
esac # }
fi # }
@@ -99,7 +123,7 @@
then
grep -q getbootfile ${LSOF_INCLUDE}/util.h
if test $? -eq 0 # {
-@@ -3501,6 +3547,7 @@ return(0); }
+@@ -3501,6 +3559,7 @@
fi # }
LSOF_TMP2="sys/vnode.h"
LSOF_NBSD_PTYFS=0
@@ -107,7 +131,7 @@
if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # {
then
LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2"
-@@ -3578,16 +3625,29 @@ return(0); }
+@@ -3578,16 +3637,29 @@
fi # }
fi # }
fi # }
@@ -144,7 +168,7 @@
fi # }
fi # }
fi # }
-@@ -3863,6 +3923,28 @@ return(0); }
+@@ -3863,6 +3935,28 @@
LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include"
fi # }
fi # }
@@ -173,7 +197,7 @@
LSOF_CFGL="$LSOF_CFGL -lkvm"
LSOF_DIALECT_DIR=n+obsd
;;
-@@ -5607,7 +5689,7 @@ fi # }
+@@ -5607,7 +5701,7 @@
echo "" >> $LSOF_MKFC
if test "X$LSOF_DEBUG" = "X" # {
then
diff -r eff109edc0cf -r 9089ed92975e sysutils/lsof/patches/patch-dialects_n+obsd_dsock.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/lsof/patches/patch-dialects_n+obsd_dsock.c Fri Jan 13 04:33:17 2023 +0000
@@ -0,0 +1,107 @@
+$NetBSD: patch-dialects_n+obsd_dsock.c,v 1.1 2023/01/13 04:33:17 mrg Exp $
+
+Handle the inpcb / inpcb6 merge.
+
+--- dialects/n+obsd/dsock.c.orig 2005-08-08 12:53:34.000000000 -0700
++++ dialects/n+obsd/dsock.c 2023-01-12 15:42:17.533910449 -0800
+@@ -58,11 +58,18 @@
+ process_socket(sa)
+ KA_T sa; /* socket address in kernel */
+ {
++#if NETBSDV >= 9099104
++# define NETBSD_MERGED_INPCB
++#endif
+ struct domain d;
+ unsigned char *fa = (unsigned char *)NULL;
+ int fam;
+ int fp, lp;
++#ifdef NETBSD_MERGED_INPCB
++ struct in4pcb inp;
++#else
+ struct inpcb inp;
++#endif
+ unsigned char *la = (unsigned char *)NULL;
+ struct protosw p;
+ struct socket s;
+@@ -73,6 +80,9 @@
+ struct sockaddr_un un;
+
+ #if defined(HASIPv6) && defined(NETBSDV) && !defined(HASINRIAIPv6)
++#ifdef NETBSD_MERGED_INPCB
++# define in6p_ppcb in6p_pcb.inp_ppcb
++#endif
+ struct in6pcb in6p;
+ #endif /* defined(HASIPv6) && defined(NETBSDV) && !defined(HASINRIAIPv6) */
+
+@@ -211,6 +221,16 @@
+ (char *)NULL, 0));
+ if (p.pr_protocol == IPPROTO_TCP)
+ ta = (KA_T)in6p.in6p_ppcb;
++#ifdef NETBSD_MERGED_INPCB
++ la = (unsigned char *)&in6p_laddr(&in6p);
++ lp = (int)ntohs(in6p.in6p_pcb.inp_lport);
++ if (!IN6_IS_ADDR_UNSPECIFIED(&in6p_faddr(&in6p))
++ || (in6p.in6p_pcb.inp_fport))
++ {
++ fa = (unsigned char *)&in6p_faddr(&in6p);
++ fp = (int)ntohs(in6p.in6p_pcb.inp_fport);
++ }
++#else
+ la = (unsigned char *)&in6p.in6p_laddr;
+ lp = (int)ntohs(in6p.in6p_lport);
+ if (!IN6_IS_ADDR_UNSPECIFIED(&in6p.in6p_faddr)
+@@ -219,13 +239,14 @@
+ fa = (unsigned char *)&in6p.in6p_faddr;
+ fp = (int)ntohs(in6p.in6p_fport);
+ }
++#endif
+ } else
+ #endif /* defined(HASIPv6) && defined(NETBSDV) && !defined(HASINRIAIPv6) */
+
+ {
+
+ /*
+- * Read IPv4 or IPv6 (OpenBSD) protocol control block.
++ * Read IPv4 or IPv6 (NetBSD) protocol control block.
+ */
+ if (!s.so_pcb
+ || kread((KA_T)s.so_pcb, (char *)&inp, sizeof(inp))) {
+@@ -242,22 +263,38 @@
+ enter_nm(Namech);
+ return;
+ }
++#ifdef NETBSD_MERGED_INPCB
++#define inp_ppcb in4p_pcb.inp_ppcb
++#define inp_lport in4p_pcb.inp_lport
++#endif
+ enter_dev_ch(print_kptr((KA_T)(inp.inp_ppcb ? inp.inp_ppcb
+ : s.so_pcb),
+ (char *)NULL, 0));
+ if (p.pr_protocol == IPPROTO_TCP)
+ ta = (KA_T)inp.inp_ppcb;
+ lp = (int)ntohs(inp.inp_lport);
++#ifdef NETBSD_MERGED_INPCB
++#undef inp_ppcb
++#undef inp_lport
++#endif
+ if (fam == AF_INET) {
+
+ /*
+ * Save IPv4 address information.
+ */
++#ifdef NETBSD_MERGED_INPCB
++ la = (unsigned char *)&in4p_laddr(&inp);
++ if (in4p_faddr(&inp).s_addr != INADDR_ANY || inp.in4p_pcb.inp_fport) {
++ fa = (unsigned char *)&in4p_faddr(&inp);
++ fp = (int)ntohs(inp.in4p_pcb.inp_fport);
++ }
++#else
+ la = (unsigned char *)&inp.inp_laddr;
+ if (inp.inp_faddr.s_addr != INADDR_ANY || inp.inp_fport) {
+ fa = (unsigned char *)&inp.inp_faddr;
+ fp = (int)ntohs(inp.inp_fport);
+ }
++#endif
+ }
+
+ #if defined(HASIPv6) && (defined(OPENBSDV) || defined(HASINRIAIPv6))
Home |
Main Index |
Thread Index |
Old Index