libpcap icon indicating copy to clipboard operation
libpcap copied to clipboard

Add hurd support, from debian

Open LocutusOfBorg opened this issue 11 years ago • 8 comments

This is the hurd support, from debian patch

LocutusOfBorg avatar Jul 29 '14 07:07 LocutusOfBorg

Any news on this?

LocutusOfBorg avatar Sep 05 '14 14:09 LocutusOfBorg

Does this patch depend upon a new autoconf?

mcr avatar Feb 15 '15 17:02 mcr

nope, it should work also without the new autoconf

LocutusOfBorg avatar Feb 15 '15 21:02 LocutusOfBorg

From a quick look at the current Hurd code in Git, the return value of a BPF filter is used only as a pass/fail indication; it doesn't limit the amount of packet data copied. For now, it's probably best to use MAXIMUM_SNAPLEN rather than 1500 in the filter.

guyharris avatar Feb 15 '15 23:02 guyharris

@LocutusOfBorg, would you like to rebase these changes on the current master branch?

infrastation avatar Jan 15 '22 15:01 infrastation

Hello, rebased and pushed!

LocutusOfBorg avatar Jan 17 '22 11:01 LocutusOfBorg

Thank you. Do not mind FreeBSD and illumos failures, which are caused by recent Valgrind changes. To try the new code, is the simplest way to setup a VM as described here?

infrastation avatar Jan 17 '22 11:01 infrastation

Hello, it should be, but also going on irc OFTC/#debian-hurd helps :)

LocutusOfBorg avatar Jan 17 '22 11:01 LocutusOfBorg

FI, it builds fine on my hurd box, provided the additional change:

patch.txt

sthibaul avatar Sep 19 '22 16:09 sthibaul

(and autoreconf of course)

sthibaul avatar Sep 19 '22 16:09 sthibaul

otherwise one gets:

gcc  -shared libpcap.so.$MAJOR_VER \
   -o libpcap.so.$VER pcap-hurd.o fad-getad.o  pcap-dbus.o  pcap.o gencode.o optimize.o nametoaddr.o etherent.o fmtutils.o savefile.o sf-pcap.o sf-pcapng.o pcap-common.o bpf_image.o bpf_filter.o bpf_dump.o scanner.o grammar.o strlcat.o strlcpy.o  -lrt -ldbus-1
/usr/bin/ld: cannot find libpcap.so.1: No such file or directory

because it's missing the -soname parameter

sthibaul avatar Sep 19 '22 17:09 sthibaul

Found the original Hurd support patch by Richard Brown in 2014.

infrastation avatar Sep 19 '22 17:09 infrastation

It took 8 years to resolve this due to a number of reasons, one of which is that none of the project maintainers have a working GNU Hurd system. I tried to rig one up today, but without success. However, @sthibaul has compile-tested the code and confirmed that the current libpcap binary package (libpcap0.8:hurd-i386 1.10.1-4) is functional for the current tcpdump binary package, so the original patch (which has been stable since 2014) and the two follow-up improvements are now in the master branch.

infrastation avatar Sep 19 '22 19:09 infrastation

This didn't include CMake support I took the configure.ac changes and tried to translate them to CMake in #1267 - new platform changes should support both configuration mechanisms. Please test that as well.

guyharris avatar Feb 04 '24 08:02 guyharris