diff options
| author | Piotr Kubaj <pkubaj@FreeBSD.org> | 2026-10-05 10:26:02 +0100 |
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2026-10-13 17:20:34 +0100 |
| commit | 24b9ec39353184a153b4eafb35911d0cfaf21802 (patch) (diff) | |
| tree | 9128ad8296df928501f97210313dcdf951b982a0 | |
| download | ports-24b9ec39353184a153b4eafb35911d0cfaf21802.tar.gz | |
| previous commit | 567395722e9ffcc9a5667571766dd9b28a818793 (net/rayfish: restrict build to amd64) | |
net/rayfish: port to other 64-bit platforms
route_manager-0.2.13: sin_zero: [0i8; 8] against a [c_char; 8] field.
Fixed with [0; 8].
tun-rs-2.8.9: imports libc::KINFO_FILE_SIZE, which libc defines only
for x86. Fixed by setting kf_structsize from size_of::<kinfo_file>().
The size is 1392 on powerpc64le from both the C header and the built
libc rlib, and the kernel accepts exactly that value.
(cherry picked from commit e55dbd67304e77785efce0411b051a421bc03ded)
| -rw-r--r-- | net/rayfish/Makefile | [diff] [file] | 6 | ||||
| -rw-r--r-- | net/rayfish/files/patch-cargo-crates_route__manager-0.2.13_src_unix__bsd_mod.rs | [diff] [file] | 11 | ||||
| -rw-r--r-- | net/rayfish/files/patch-cargo-crates_tun-rs-2.8.9_src_platform_freebsd_device.rs | [diff] [file] | 20 |
3 files changed, 34 insertions, 3 deletions
diff --git a/net/rayfish/Makefile b/net/rayfish/Makefile index 9018e130123d..794937ad8bd4 100644 --- a/net/rayfish/Makefile +++ b/net/rayfish/Makefile @@ -7,11 +7,11 @@ MAINTAINER= feld@FreeBSD.org COMMENT= P2P mesh VPN powered by Iroh WWW= https://rayfish.xyz -ONLY_FOR_ARCHS= amd64 -ONLY_FOR_ARCHS_REASON= route_manager crate only supports target x86_64-unknown-freebsd - LICENSE= MPL20 +NOT_FOR_ARCHS= armv6 armv7 i386 powerpc powerpcspe +NOT_FOR_ARCHS_REASON= route_manager crate ships bindings pregenerated for LP64 targets + USES= cargo GROUPS= rayfish diff --git a/net/rayfish/files/patch-cargo-crates_route__manager-0.2.13_src_unix__bsd_mod.rs b/net/rayfish/files/patch-cargo-crates_route__manager-0.2.13_src_unix__bsd_mod.rs new file mode 100644 index 000000000000..c7980ee063e7 --- /dev/null +++ b/net/rayfish/files/patch-cargo-crates_route__manager-0.2.13_src_unix__bsd_mod.rs @@ -0,0 +1,11 @@ +--- cargo-crates/route_manager-0.2.13/src/unix_bsd/mod.rs.orig 2006-07-24 01:21:28 UTC ++++ cargo-crates/route_manager-0.2.13/src/unix_bsd/mod.rs +@@ -627,7 +627,7 @@ impl From<Ipv4Addr> for sockaddr_in { + sin_addr: in_addr {
+ s_addr: u32::from_ne_bytes(ip.octets()),
+ },
+- sin_zero: [0i8; 8],
++ sin_zero: [0; 8],
+ }
+ }
+ }
diff --git a/net/rayfish/files/patch-cargo-crates_tun-rs-2.8.9_src_platform_freebsd_device.rs b/net/rayfish/files/patch-cargo-crates_tun-rs-2.8.9_src_platform_freebsd_device.rs new file mode 100644 index 000000000000..27b7d0b2105e --- /dev/null +++ b/net/rayfish/files/patch-cargo-crates_tun-rs-2.8.9_src_platform_freebsd_device.rs @@ -0,0 +1,20 @@ +--- cargo-crates/tun-rs-2.8.9/src/platform/freebsd/device.rs.orig 2006-07-24 01:21:28 UTC ++++ cargo-crates/tun-rs-2.8.9/src/platform/freebsd/device.rs +@@ -11,7 +11,7 @@ use crate::{ + use crate::platform::unix::device::{copy_device_name, ctl, ctl_v6};
+ use libc::{
+ self, c_char, c_short, fcntl, ifreq, kinfo_file, AF_LINK, F_KINFO, IFF_RUNNING, IFF_UP,
+- IFNAMSIZ, KINFO_FILE_SIZE, O_RDWR,
++ IFNAMSIZ, O_RDWR,
+ };
+ use std::io::ErrorKind;
+ use std::os::fd::{IntoRawFd, RawFd};
+@@ -288,7 +288,7 @@ impl DeviceImpl { + use std::path::PathBuf;
+ unsafe {
+ let mut path_info: kinfo_file = std::mem::zeroed();
+- path_info.kf_structsize = KINFO_FILE_SIZE;
++ path_info.kf_structsize = std::mem::size_of::<kinfo_file>() as libc::c_int;
+ if fcntl(tun.as_raw_fd(), F_KINFO, &mut path_info as *mut _) < 0 {
+ return Err(io::Error::last_os_error());
+ }
|
