Re: Fwd: [PATCH 1/6] New libpcap BPF backend

Joan Lledó <[email protected]>
Newsgroups gmane.os.hurd.bugs
Message-ID <[email protected]>
Hi Roy,

I'm adding the Hurd mailing list to CC.

El 19/5/26 a les 14:21, Roy Marples ha escrit:
> Hi
> 
> Thanks for the patch, I've merged it here:
> https://github.com/NetworkConfiguration/dhcpcd/ 
> commit/6ae07424aff786e0feb83f4f008725716bd7c5ce <https://github.com/ 
> NetworkConfiguration/dhcpcd/commit/6ae07424aff786e0feb83f4f008725716bd7c5ce>
> 

I didn't open a PR for the patches because I'm still not 100% sure these 
are going to be the final patches, since I'm still waiting for this PR 
to be merged by libpcap maintainers:

https://github.com/the-tcpdump-group/libpcap/pull/1565

But thanks anyway, I don't think I'll need to change any of the patches, 
but who knows.

> This actually triggered a fair bit of work, splitting out the BSD and 
> DLPI specifics new files.
> I also optimised the pcap code a little with the final result here:
> https://github.com/NetworkConfiguration/dhcpcd/blob/master/src/bpf- 
> pcap.c <https://github.com/NetworkConfiguration/dhcpcd/blob/master/src/ 
> bpf-pcap.c>
> 
> As part of this, I did actually patch libpcap to support BSD write 
> filter and lock mechanisms but it seems upstream is resistant to this 
> change because it's BSD only even though it provides a mechanism to 
> harden the use of libpcap in a public facing application.
> https://github.com/the-tcpdump-group/libpcap/pull/1683 <https:// 
> github.com/the-tcpdump-group/libpcap/pull/1683>
> 
> So, my question is how hard would it be to add BPF write filtering and 
> filter locking to GNU/Hurd?

Maybe others in the Hurd list answer this, they can probably answer 
better than me.

The first idea that comes to my mind is to actually create the BPF 
translator for the hurd, installed at /dev/bpf, following the BSD 
interface. That way we could implement such operations via RPCs or via 
ioctls. That way, both libpcap and dhcpcd could use their existing BSD 
backends for the hurd.

But we don't have such translator as for today, so, unless gnumach 
supports such features, I don't know how can we implement 
pcap_setwritefilter() and pcap_lockfilter() on libpcap for the hurd.


> Hopefully the rest of the patches won't be so onerous!
> 

Please take into account the Patch 5 about the `./configure` has some AI 
generated code, since I don't really know much about shell scripting.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.