-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't build/run on macOS due to client.go code #229
Comments
cc @get9 |
This is actually something I've considered in the past, splitting client and server from protocol parsing. The library structure wold become a bit more fragmented but I can try and see if it doesn't look too bad. |
I'm fine with that; this package should be reserved for dhcp library code. We can have a separate one for sample clients that's a consumer of this code. Do we have CI set up for mac builds of this library? |
Compiling for FreeBSD I ran into the same thing. |
I think what @begetan meant was to split out client.go and server.go in a separate package, correct me if I'm wrong. As per the sample client, there is a working (yet not full-featured) dhclient implementation in the examples repo, https://github.com/insomniacslk/exdhcp/blob/master/dhclient/main.go
No, the tests are linux-only. We would just need an |
This is the PR that broke the build, http://github.com/insomniacslk/dhcp/pull/198 (not the commit mentioned above). AF_PACKET was introduced to deal with unconfigured interfaces, which is fundamental for a DHCP client to work, but AF_PACKET is Linux-specific. I'll work on a fix for darwin/freebsd |
Quick search: https://stackoverflow.com/questions/17169298/af-packet-on-osx EDIT: this doesn't help as it basically recommends to go back to L3 sockets and wouldn't work on unconfigured interfaces |
If I'm reading it right, dhclient in FreeBSD uses... BPF, https://github.com/freebsd/freebsd/blob/master/sbin/dhclient/bpf.c#L100 . Basically like running tcpdump |
Exactly! That packages can handle network specific stuff (like this case) so people can manage which component of the library they actually need. |
Tracked at #231 |
not really - the build still fails on darwin. Just not a hi-pri at the moment |
Any update yet on being able to use the client on non-linux (eg darwin) ? |
PRs are welcomed. There is even a patch that needs testing in #378 (comment). |
Related: The main package should compile now and the nclient code should be usable. |
The client code was moved to a separate package since. I am leaving #318 for OSX related support. |
There are no constants in package golang.org/x/sys/unix for darwin_amd64
This is a commit probably breaks compilation:
4eedccf
In BSD system AF_PACKET should be replaced by AF_LINK
BTW, why not to move client for separate package? I just removed file client.go from repo in order to compile server code.
The text was updated successfully, but these errors were encountered: