ofalk / libdnet

libdnet provides a simplified, portable interface to several low-level networking routines.
Other
153 stars 60 forks source link

CMake, BSD: Fix BPF detection, use clonable device #90

Closed klemensn closed 1 year ago

klemensn commented 1 year ago
klemensn commented 1 year ago

There's more to fix in the CMake code and it makes sense to have it in one PR, so converting it to a draft until I have everything...

klemensn commented 1 year ago

This gets src/eth-bsd.c to be used instead of src/eth-none.c on OpenBSD, as expected. Linux should still pick src/eth-linux.c, but I haven't built there.

/dev/tun0 detection is equally broken and can use the same fix, but that should be another PR.

ofalk commented 1 year ago

Awesome @klemensn - happy someone is looking into the BSD part, because I have none to my avail at the moment ! May I consider this read to be merged?

klemensn commented 1 year ago

Awesome @klemensn - happy someone is looking into the BSD part, because I have none to my avail at the moment ! May I consider this read to be merged?

Your call -- if this looks good enough, I'll fix other CMake stuff as well until OpenBSD is happy enough that I can consider switching upgrading our official net/libdnet port/package and switch it over to from GNU auto* tooling.

Works (better) for me, I don't see how this would make it worse for any other system...

ofalk commented 1 year ago

Awesome @klemensn - happy someone is looking into the BSD part, because I have none to my avail at the moment ! May I consider this read to be merged?

Your call -- if this looks good enough, I'll fix other CMake stuff as well until OpenBSD is happy enough that I can consider switching upgrading our official net/libdnet port/package and switch it over to from GNU auto* tooling.

Works (better) for me, I don't see how this would make it worse for any other system...

Builds fine on Linux and it looks fine. I'll merge it in a sec - this time as merge commit - not squash it :-)