diff --git a/pkg/dhcp/dhcp.go b/pkg/dhcp/dhcp.go index a5be160..7108eed 100644 --- a/pkg/dhcp/dhcp.go +++ b/pkg/dhcp/dhcp.go @@ -96,6 +96,7 @@ func (c *Client) FeedFrame(frame []byte) { // sendFrame is called to transmit each Ethernet frame through the tunnel. // Returns the lease on success. func (c *Client) Run(sendFrame func([]byte) error, timeout time.Duration) (*Lease, error) { + c.xid = rand.Uint32() // Send DISCOVER disc := c.buildDiscover() if err := sendFrame(disc); err != nil { @@ -154,6 +155,7 @@ func (c *Client) Run(sendFrame func([]byte) error, timeout time.Duration) (*Leas // In RENEWING state: ciaddr = current IP, no requested-IP or server-ID options. // Returns the renewed lease on ACK, or error on NAK/timeout. func (c *Client) Renew(currentIP net.IP, sendFrame func([]byte) error, timeout time.Duration) (*Lease, error) { + c.xid = rand.Uint32() var ciaddr [4]byte copy(ciaddr[:], currentIP.To4())