diff options
Diffstat (limited to 'dhcpv4/async')
-rw-r--r-- | dhcpv4/async/client.go | 8 | ||||
-rw-r--r-- | dhcpv4/async/client_test.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/dhcpv4/async/client.go b/dhcpv4/async/client.go index c37d249..9844180 100644 --- a/dhcpv4/async/client.go +++ b/dhcpv4/async/client.go @@ -132,7 +132,7 @@ func (c *Client) senderLoop(ctx context.Context) { func (c *Client) send(packet *dhcpv4.DHCPv4) { c.packetsLock.Lock() - p := c.packets[packet.TransactionID()] + p := c.packets[packet.TransactionID] c.packetsLock.Unlock() raddr, err := c.remoteAddr() @@ -174,8 +174,8 @@ func (c *Client) receive(_ *dhcpv4.DHCPv4) { } c.packetsLock.Lock() - if p, ok := c.packets[received.TransactionID()]; ok { - delete(c.packets, received.TransactionID()) + if p, ok := c.packets[received.TransactionID]; ok { + delete(c.packets, received.TransactionID) p.Resolve(received) } c.packetsLock.Unlock() @@ -201,7 +201,7 @@ func (c *Client) Send(message *dhcpv4.DHCPv4, modifiers ...dhcpv4.Modifier) *pro p := promise.NewPromise() c.packetsLock.Lock() - c.packets[message.TransactionID()] = p + c.packets[message.TransactionID] = p c.packetsLock.Unlock() c.sendQueue <- message return p.Future diff --git a/dhcpv4/async/client_test.go b/dhcpv4/async/client_test.go index 4be6edd..7fa0e9e 100644 --- a/dhcpv4/async/client_test.go +++ b/dhcpv4/async/client_test.go @@ -121,5 +121,5 @@ func TestSend(t *testing.T) { require.True(t, ok) require.False(t, timeout) require.NoError(t, err) - require.Equal(t, m.TransactionID(), r.TransactionID()) + require.Equal(t, m.TransactionID, r.TransactionID) } |