Re: Guidance to implement io_select on network devices

Roy Marples <[email protected]> Sat, 13 Jun 2026 10:17:29 +0100
Newsgroups gmane.os.hurd.bugs
Message-ID <[email protected]>
Hi Joan

From: Joan Lledó <[email protected]>
To: "Roy Marples"<[email protected]>
Cc: "bug-hurd"<[email protected]>
Date: Sat, 13 Jun 2026 09:17:58 +0100
Subject: Re: Guidance to implement io_select on network devices

 > Hi Roy, 
 >  
 > El 12/6/26 a les 22:14, Roy Marples ha escrit: 
 >  
 > > The privilege separation is done. 100% working on Hurd in a POSIX limited sandbox. 
 >  
 > In your `hurd_test` branch? in that branch `src/privsep-hurd.c` is just 
 > a stub, is it working?. How can I test this locally to ensure it works 
 > for me? 

if-hurd.c and privsep-hurd.c are mostly stubs because setting up IPv4 is pretty common
amongst all platforms and the only hurd specifics we need is the ability to get the
interface index and hardware address - other platforms can get this via getifaddrs and
look at AF_LINK/AF_PACKET address which the Hurd lacks.
The Hurd also lacks important things like interface/address/route state change notification.

Anyway.....

Checkout the hurd_test branch
./configure
make
sudo make install

Ensure pfinet is running

sudo dhcpcd

And the 10-pfinet hook script we installed should then configure pfinet on the fly with the needed details
and configure resolv.conf for you.

IF lwip only supports one interface then it could be configured the same way.
Otherwise we'll need to start adding ioctls to if-hurd.c to handle setup.

 >  
 > > One thing I lack the time to do because I am very much limited by my inability to upgrade 
 > > much on my Hurd VM is fix the ethernet header disater. 
 > > If you can get any changes upstreamed to Hurd libc I would appreciate that greatly. 
 > > 
 > > See here on my hurd_test branch: 
 > > https://github.com/NetworkConfiguration/dhcpcd/commit/cbd462a9a671a5bd20212eba4619aca5f4e8bc5e#diff-9625d3bf762014910c77568e8fab6f16ed8a0c3891483266d32e47793ec9b41e 
 > > 
 > > #ifdef __GNU__ 
 > > #include <net/ethernet.h> 
 > > #include <net/if_arp.h> 
 > > #else 
 > > #include <netinet/if_ether.h> 
 > > #endif 
 > > 
 > > I should NOT have to do this. 
 > > Every other OS dhcpcd compiles on (it's a long exhaustive list) pulls in what I need from netinet/if_ether.h 
 > > Relevant upstream bug: https://sourceware.org/bugzilla/show_bug.cgi?id=11142 
 > > 
 > > Again, if you can progress that so I don't have to special case Hurd each time I want some ethernet stuff I would greatly appreciate it. 
 >  
 > Yes, of course. I'll take your branch as base and will work on a a 
 > series of patches that work bypassing libpcap. I'll also figure out 
 > about the ehternet headers. 

No need to bypass it, dhcpcd configure works out it's Hurd and compiles in bpf-hurd.c

Thanks

Roy