pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add a patch for NetBSD for the vendor/net2 crate.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Fri Dec 11 18:14:34 2020 +0100
Changeset:	e079b4436d99788573fbc9a9729aafb314bf49de

Modified Files:
	routinator/Makefile
	routinator/distinfo
Added Files:
	routinator/patches/patch-vendor_net2-0.2.36_src_ext.rs

Log Message:
Add a patch for NetBSD for the vendor/net2 crate.

NetBSD doesn't actually need the same workaround as OpenBSD and Haiku;
on the TCP level, the TCP_KEEPALIVE socket option is recognized.

Without this we saw

 13038     19 routinator CALL  setsockopt(0x15,0xffff,8,0x7d60bd3d62b4,4)
 13038     19 routinator RET   setsockopt 0
 13038     19 routinator CALL  setsockopt(0x15,6,8,0x7d60bd3d62b4,4)
 13038     19 routinator RET   setsockopt -1 errno 42 Protocol option not available

and '8' in the latter corresponds to the

from <netinet/tcp.h> if I'm not sorely mistaken.  Instead we end up
using TCP_KEEPIDLE, which works fine by the looks of it.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e079b4436d99788573fbc9a9729aafb314bf49de

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 routinator/Makefile                                    |  1 +
 routinator/distinfo                                    |  1 +
 routinator/patches/patch-vendor_net2-0.2.36_src_ext.rs | 16 ++++++++++++++++
 3 files changed, 18 insertions(+)

diffs:
diff --git a/routinator/Makefile b/routinator/Makefile
index 4972c9f2c8..df096947ea 100644
--- a/routinator/Makefile
+++ b/routinator/Makefile
@@ -2,6 +2,7 @@
 
 DISTNAME=	routinator-0.8.2
 PKGNAME=	${DISTNAME:S/-rc/rc/}
+PKGREVISION=	1
 CATEGORIES=	net
 EXTRACT_SUFX=	.tar.gz
 
diff --git a/routinator/distinfo b/routinator/distinfo
index 2927d60a3c..30f530e192 100644
--- a/routinator/distinfo
+++ b/routinator/distinfo
@@ -796,3 +796,4 @@ SHA1 (ws2_32-sys-0.2.1.crate) = dae41c117c3746c05852b6ce72f17954e6d6dd8b
 RMD160 (ws2_32-sys-0.2.1.crate) = 883038c3ec6db615e0c96f0788f1a24892a855b2
 SHA512 (ws2_32-sys-0.2.1.crate) = 18356861fc595efe7d0180afb8ce7649da35a4f9ba456271d2068679ab258a861af32a2e016e241fbfbf5f6ef0eb33127b26eabfc11428af39506538faa4821f
 Size (ws2_32-sys-0.2.1.crate) = 4697 bytes
+SHA1 (patch-vendor_net2-0.2.36_src_ext.rs) = 7eac1cd01be00bcd63ea95e959a26d3f912fa97a
diff --git a/routinator/patches/patch-vendor_net2-0.2.36_src_ext.rs b/routinator/patches/patch-vendor_net2-0.2.36_src_ext.rs
new file mode 100644
index 0000000000..ca3816a798
--- /dev/null
+++ b/routinator/patches/patch-vendor_net2-0.2.36_src_ext.rs
@@ -0,0 +1,16 @@
+$NetBSD$
+
+NetBSD doesn't actually need the same workaround as OpenBSD and Haiku;
+on the TCP level, the TCP_KEEPALIVE socket option is recognized.
+
+--- ../vendor/net2-0.2.36/src/ext.rs.orig	2020-09-07 17:29:04.000000000 +0000
++++ ../vendor/net2-0.2.36/src/ext.rs
+@@ -668,7 +668,7 @@ impl<T: AsRawSocket> AsSock for T {
+ cfg_if! {
+     if #[cfg(any(target_os = "macos", target_os = "ios"))] {
+         use libc::TCP_KEEPALIVE as KEEPALIVE_OPTION;
+-    } else if #[cfg(any(target_os = "haiku", target_os = "netbsd", target_os = "openbsd"))] {
++    } else if #[cfg(any(target_os = "haiku", target_os = "openbsd"))] {
+         use libc::SO_KEEPALIVE as KEEPALIVE_OPTION;
+     } else if #[cfg(unix)] {
+         use libc::TCP_KEEPIDLE as KEEPALIVE_OPTION;


Home | Main Index | Thread Index | Old Index