Hi Hurd, 

I've been working on a port of dhcpcd to the Hurd. I had to make            
some changes in libpcap and the lwip translator to make it work.

Here are the changes for libpcap. Basically this implements the
`selectable_fd` pcap feature for the Hurd. This is needed because
dhcpcd needs a fd to insert in an event loop. The event loop keeps
waiting on poll(), so we need to provide it with a descriptor able
to be sent to poll(). When the fd is signaled, dhcpcd calls the read
function to get the data from a BPF filter.

In this patch, my approach is to make the data pass through a pipe,
which read end is going to be the selectable_fd for dhcpcd. When capture
starts, a new thread reads packets from gnumach bpf and pushes them to
the pipe. When the pipe has data, dhcpcd is signaled and it will call
the read function, which I modified to read from the pipe and return data
to dhcpcd. This is working fine in my local tests, but I'd appreciate a
review.

Thanks.

Reply via email to