summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/async
diff options
context:
space:
mode:
authorChristopher Koch <chrisko@google.com>2018-12-28 17:35:48 -0800
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-09 23:54:01 +0000
commit108ed92e1c9901936541020bc3214533acce77bb (patch)
treef1b8806daa9a4a3d3f105dda78be9afeeb756012 /dhcpv4/async
parent4d2cfd40eee7dd315385d320534b6c99094449e9 (diff)
dhcpv4: export packet members; remove setters and getters.
Diffstat (limited to 'dhcpv4/async')
-rw-r--r--dhcpv4/async/client.go8
-rw-r--r--dhcpv4/async/client_test.go2
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)
}