diff options
author | Marco Guerri <marcoguerri@users.noreply.github.com> | 2019-05-09 09:41:10 +0100 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2019-05-09 09:41:10 +0100 |
commit | b743592c9784d62cbadcabab89f81b7914393918 (patch) | |
tree | 1da1ce48f686d725a2e46b390aa746fe7b115f0d /dhcpv4 | |
parent | 5dea7039d65e5b94fa681b17bc4a3bf63aa47994 (diff) |
[dhcpv4] Do not Gateway IP address on packets sent by clients (#287)
Relays might drop packets coming from clients if they have the
Gateway IP set. This modifier is supposed to be used by relays:
`WithReply` is used only by clients.
Diffstat (limited to 'dhcpv4')
-rw-r--r-- | dhcpv4/dhcpv4_test.go | 2 | ||||
-rw-r--r-- | dhcpv4/modifiers.go | 1 |
2 files changed, 0 insertions, 3 deletions
diff --git a/dhcpv4/dhcpv4_test.go b/dhcpv4/dhcpv4_test.go index 996b481..63c00d0 100644 --- a/dhcpv4/dhcpv4_test.go +++ b/dhcpv4/dhcpv4_test.go @@ -256,7 +256,6 @@ func TestNewReplyFromRequest(t *testing.T) { reply, err := NewReplyFromRequest(discover) require.NoError(t, err) require.Equal(t, discover.TransactionID, reply.TransactionID) - require.Equal(t, discover.GatewayIPAddr, reply.GatewayIPAddr) } func TestNewReplyFromRequestWithModifier(t *testing.T) { @@ -267,7 +266,6 @@ func TestNewReplyFromRequestWithModifier(t *testing.T) { reply, err := NewReplyFromRequest(discover, userClass) require.NoError(t, err) require.Equal(t, discover.TransactionID, reply.TransactionID) - require.Equal(t, discover.GatewayIPAddr, reply.GatewayIPAddr) } func TestDHCPv4MessageTypeNil(t *testing.T) { diff --git a/dhcpv4/modifiers.go b/dhcpv4/modifiers.go index 1659b21..477f48f 100644 --- a/dhcpv4/modifiers.go +++ b/dhcpv4/modifiers.go @@ -49,7 +49,6 @@ func WithReply(request *DHCPv4) Modifier { d.TransactionID = request.TransactionID d.ClientHWAddr = request.ClientHWAddr d.Flags = request.Flags - d.GatewayIPAddr = request.GatewayIPAddr } } |