1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

net-mgmt/bandwhich: fix build on powerpc and arm architectures

chars are unsigned on arm and ppc.
This commit is contained in:
Piotr Kubaj 2020-10-12 10:49:50 +00:00
parent 617e8ec56d
commit 6905850049
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=552121
2 changed files with 17 additions and 0 deletions

View File

@ -264,6 +264,12 @@ CARGO_USE_GITHUB= yes
PLIST_FILES= bin/bandwhich \
man/man1/bandwhich.1.gz
.include <bsd.port.options.mk>
.if ${ARCH} == aarch64 || ${ARCH:Marmv*} || ${ARCH:Mpowerpc*}
EXTRA_PATCHES= ${FILESDIR}/extra-patch-cargo-crates_pnet__datalink-0.26.0_src_bpf.rs
.endif
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/bandwhich
${INSTALL_MAN} ${WRKSRC}/docs/bandwhich.1 ${STAGEDIR}${MAN1PREFIX}/man/man1

View File

@ -0,0 +1,11 @@
--- cargo-crates/pnet_datalink-0.26.0/src/bpf.rs.orig 2020-10-11 18:58:25 UTC
+++ cargo-crates/pnet_datalink-0.26.0/src/bpf.rs
@@ -130,7 +130,7 @@ pub fn channel(network_interface: &NetworkInterface, c
}
let mut iface: bpf::ifreq = unsafe { mem::zeroed() };
for (i, c) in network_interface.name.bytes().enumerate() {
- iface.ifr_name[i] = c as i8;
+ iface.ifr_name[i] = c as u8;
}
let buflen = config.read_buffer_size as libc::c_uint;