Comments (8)
That error comes from the stdlib's syscall package. I haven't dug deeper yet, but go.universe.tf/netboot/dhcp4 is the package that does the most complex/unusual low-level socket operations (using golang.org/x/net/ipv4), so I suspect it's a codepath in x/net/ipv4 that's doing something not implemented on windows.
If that's the case, unfortunately there's not much I can do about it, the default codepath in dhcp4 is already as portable as I was able to make it, so it's x/net/ipv4 that would need extra windows support.
I'll dig more later today to see if I can identify a specific codepath.
from netboot.
@danderson how do you debug it? I tried delve
, but it doesn't work on 32-bit Windows (https://github.com/derekparker/delve/issues/656).
from netboot.
I don't use windows at all, so I don't know what debugger options exist. My strategy would be to add fmt.Println statements in https://github.com/google/netboot/blob/master/pixiecore/pixiecore.go#L185 to trace the initialization. I suspect it's newDHCP that is returning the error, but I could be wrong.
Once you find the function call that's returning the error, you can continue drilling down from there into that function and see which call is failing.
My guess, just looking at the code, is that the error comes from this SetControlMessage call in the dhcp4 package: https://github.com/google/netboot/blob/master/dhcp4/conn.go#L169 . This uses x/net/ipv4 to get information about the network interface that received a packet (required for DHCP, because we have to broadcast responses on the correct interface). My guess is that x/net/ipv4 has a TODO for supporting interface info.
from netboot.
bingo: https://github.com/golang/net/blob/master/ipv4/control_windows.go#L10
Looks like socket control messages are not at all implemented in x/net/ipv4, so the dhcp4 package cannot initialize on windows. If you know how to support this functionality for windows, pull requests for x/net are very welcome.
from netboot.
Hmm.. I am trying to understand this. pixiecore
listens on all interfaces, and when a packer is received, it is impossible to tell which interface it was? How come?
I found https://stackoverflow.com/questions/3062205/setting-the-source-ip-for-a-udp-socket?noredirect=1&lq=1 - is it talking about the same issue?
from netboot.
The problem pixiecore has is not the same as the stackoverflow question, it's related to how DHCP works.
With a normal client<->server communication, when you receive a packet, you have both the source (client) IP and the destination (server) IP, so you can easily tell where the client is located and how to respond.
But with DHCP, when the client sends the DHCPDISCOVER packet, it does not have an IP address yet. So, the packet has a source IP of 0.0.0.0 (none), and a destination of 255.255.255.255 (broadcast). And we have to broadcast the response to 255.255.255.255 as well.
With the basic socket APIs, when you receive such a packet, you have no information at all about where the client is (which network interface), you just know that it sent a broadcast packet and your machine was able to see it. So, you don't know where you should send the response.
The function call at https://github.com/google/netboot/blob/master/dhcp4/conn.go#L169 uses an extension of the socket API to ask for interface information. So, when we receive a packet using this API, we get the packet, but also the OS tells us exactly the interface the packet arrived on. Then, when we send the response, we use this extension again, and tell the OS "please send this packet on interface X".
This extension to the basic socket API is required to implement DHCP correctly, because it's a slightly weird protocol that has to talk to clients with no IP addresses. I'm sure Windows offers a similar API to get this information, but x/net/ipv4 has no windows experts, so the support is missing (golang/go#7175).
from netboot.
How the interface on which a message received is identified? Is it an IP address or MAC?
from netboot.
Need time to wrap my head around system specific socket interface flags. I wish there was some table with socket optons and features. I guess on Linux conn.go
wraps IP_PKTINFO
flag described at https://linux.die.net/man/7/ip which seems implemented on Windows - https://msdn.microsoft.com/en-us/library/windows/desktop/hh285668(v=vs.85).aspx
Maybe a more simple workaround is to just listen on all interfaces separately?
from netboot.
Related Issues (20)
- Running on macOS fails with setsockopt: invalid argument HOT 3
- Package from packagecloud.io not working. Status code 429.
- Option to disable the DHCP server HOT 1
- make update-ipxe error HOT 5
- enable docker hub autobuild and update docker image(s) HOT 2
- RPI4 netboot support HOT 2
- TFTP bug: response source IP is not client request HOT 1
- tftp test is failing: package go.universe.tf/netboot/cmd/pixiecore: cannot find package HOT 3
- quick for archlinux not working HOT 3
- docker pull pixiecore/pixiecore fails
- pixiecore quick xyz is legacy BIOS only by default? HOT 4
- unsupported client firmware type '0' (please file a bug!) HOT 7
- Cannot install pixiecore HOT 2
- how to prevent pxe boot looping HOT 1
- Is it possible to run pixiecore with cloud-init config? HOT 1
- Netboot with NixOS HOT 1
- Arch Linux quick command needs cms_verify=y HOT 1
- [Discussion] IPV6 Exploration pixiecore HOT 1
- [DHCP] Unusable packet from xx:xx:xx:xx:xx:xx: unsupported client firmware type '16' (please file a bug!) despite using AMD64 HOT 2
- [PIXIECORE] No configuration method succeeded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netboot.