MFH: r552121

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

chars are unsigned on arm and ppc.

Approved by:	portmgr (fix build blanket)
This commit is contained in:
Piotr Kubaj 2020-10-21 19:01:00 +00:00
parent d4b6af12e0
commit 25e20a09d4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q4/; revision=552881
2 changed files with 17 additions and 0 deletions

View File

@ -223,6 +223,12 @@ CARGO_CRATES= adler32-1.0.4 \
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;