dhcp ipam: fix client id
First byte of client ID is type, instead of value. See this from RFC2132: Code Len Type Client-Identifier +-----+-----+-----+-----+-----+--- | 61 | n | t1 | i1 | i2 | ... +-----+-----+-----+-----+-----+--- Signed-off-by: SilverBut <SilverBut@users.noreply.github.com>
This commit is contained in:
parent
a1051f3bf1
commit
27fdec5cb9
@ -218,6 +218,10 @@ func (l *DHCPLease) acquire() error {
|
||||
for k, v := range l.optsProviding {
|
||||
opts[k] = v
|
||||
}
|
||||
// client identifier's first byte is "type"
|
||||
newClientID := []byte{0}
|
||||
newClientID = append(newClientID, opts[dhcp4.OptionClientIdentifier]...)
|
||||
opts[dhcp4.OptionClientIdentifier] = newClientID
|
||||
|
||||
pkt, err := backoffRetry(l.resendMax, func() (*dhcp4.Packet, error) {
|
||||
ok, ack, err := DhcpRequest(c, opts)
|
||||
|
Loading…
x
Reference in New Issue
Block a user