Please use the v2 branch for all projects.
d2g / dhcp4client Goto Github PK
View Code? Open in Web Editor NEWDHCP Client
License: Mozilla Public License 2.0
DHCP Client
License: Mozilla Public License 2.0
Please use the v2 branch for all projects.
The current default branch of V2 broke e.g. github.com/gokrazy/gokrazy/cmd/dhcp:
% go get -u github.com/gokrazy/gokrazy/cmd/dhcp
# github.com/gokrazy/gokrazy/cmd/dhcp
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:60:14: cannot use &discoveryPacket (type *"github.com/krolaw/dhcp4".Packet) as type *"github.com/d2g/dhcp4".Packet in argument to addHostname
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:61:14: cannot use &discoveryPacket (type *"github.com/krolaw/dhcp4".Packet) as type *"github.com/d2g/dhcp4".Packet in argument to addClientId
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:64:13: c.SendPacket undefined (type *dhcp4client.Client has no field or method SendPacket)
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:65:3: cannot use discoveryPacket (type "github.com/krolaw/dhcp4".Packet) as type "github.com/d2g/dhcp4".Packet in return argument
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:70:3: cannot use offerPacket (type "github.com/krolaw/dhcp4".Packet) as type "github.com/d2g/dhcp4".Packet in return argument
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:74:14: cannot use &requestPacket (type *"github.com/krolaw/dhcp4".Packet) as type *"github.com/d2g/dhcp4".Packet in argument to addHostname
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:75:14: cannot use &requestPacket (type *"github.com/krolaw/dhcp4".Packet) as type *"github.com/d2g/dhcp4".Packet in argument to addClientId
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:78:13: c.SendPacket undefined (type *dhcp4client.Client has no field or method SendPacket)
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:79:3: cannot use requestPacket (type "github.com/krolaw/dhcp4".Packet) as type "github.com/d2g/dhcp4".Packet in return argument
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:84:3: cannot use acknowledgement (type "github.com/krolaw/dhcp4".Packet) as type "github.com/d2g/dhcp4".Packet in return argument
/tmp/gp/src/github.com/gokrazy/gokrazy/cmd/dhcp/dhcp.go:84:3: too many errors
In client.go:308, the server address for a renewal request is set to the SIAddr field from the previous request. In certain cases, this is wrong.
The SIAddr field is the server address to use for the next step in DHCP, which after a DISCOVER/OFFER/REQUEST/ACK sequence is to retrieve a PXE boot image. So if a network uses different hosts for DHCP and PXEboot, the ACK packet's SIAddr field will point to the PXEboot server, not the DHCP server, and any renewal request sent to this server will fail.
The correct thing would be to record the address the UDP packet containing the ACK came from and use that as the server address for renewal.
Is there anyone used the DHCP cni plugin, any idea how to handle the issue
$ sudo ./dhcp daemon
2017/10/13 10:58:22 39919c7d9d9c451fdd35ae72ec1d331f317112e5bce27276326f784c4bc0bc56/: acquiring lease
2017/10/13 10:58:22 Link "eth0" down. Attempting to set up
2017/10/13 10:58:22 network is down
2017/10/13 10:58:32 resource temporarily unavailable
2017/10/13 10:58:45 resource temporarily unavailable
Please implement feature to provide hostname.
Thanks.
The client (v2) currently assumes that the Server Identified (Option 54) is included in the response ACK and NACK packets as per RFC 2131 p28.
This however contradicts RFC 2132 p27.
This issue is to identify if this inconstancy requires addressing within the client. Therefore, if you are aware of an server implementation that doesn't return the server identifier (Option 54) in ACK and/or NACK dhcp4 responses, please provide details.
third_party/src/github.com/d2g/dhcp4client/pktsock_linux.go:92: cannot use int64(t.Seconds()) (type int64) as type int32 in field value
third_party/src/github.com/d2g/dhcp4client/pktsock_linux.go:93: cannot use t.Nanoseconds() (type int64) as type int32 in field value
Please add support for option 12 to the dhcp4client library.
Currently I've only tested with an interface that already has an IP.
Hi.
Just wondering if there is any example code or documentation on how to use the package.
Thanks,
The current implementation can not be bound to a specific interface.
I implement a DHCPv4 client on my own. In case someone is interested in the code: https://github.com/digineo/go-dhclient
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.