mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-02 14:10:29 +03:00
cherry-pick: 4836-revert-dhcp-upd
Updates #4836. Squashed commit of the following: commit 6fe1721d44be1c23e524d477e28b5f7cc5dd2dc6 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Aug 15 17:48:41 2022 +0300 dhcpd: reverd mod upd
This commit is contained in:
parent
3c52a021b9
commit
6ea4788f56
6 changed files with 24 additions and 20 deletions
internal/dhcpd
|
@ -11,9 +11,11 @@ import (
|
|||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
"github.com/insomniacslk/dhcp/dhcpv4"
|
||||
"github.com/mdlayher/packet"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
//lint:ignore SA1019 See the TODO in go.mod.
|
||||
"github.com/mdlayher/raw"
|
||||
)
|
||||
|
||||
func TestDHCPConn_WriteTo_common(t *testing.T) {
|
||||
|
@ -56,7 +58,7 @@ func TestBuildEtherPkt(t *testing.T) {
|
|||
srcIP: net.IP{1, 2, 3, 4},
|
||||
}
|
||||
peer := &dhcpUnicastAddr{
|
||||
Addr: packet.Addr{HardwareAddr: net.HardwareAddr{6, 5, 4, 3, 2, 1}},
|
||||
Addr: raw.Addr{HardwareAddr: net.HardwareAddr{6, 5, 4, 3, 2, 1}},
|
||||
yiaddr: net.IP{4, 3, 2, 1},
|
||||
}
|
||||
payload := (&dhcpv4.DHCPv4{}).ToBytes()
|
||||
|
@ -102,7 +104,7 @@ func TestBuildEtherPkt(t *testing.T) {
|
|||
t.Run("serializing_error", func(t *testing.T) {
|
||||
// Create a peer with invalid MAC.
|
||||
badPeer := &dhcpUnicastAddr{
|
||||
Addr: packet.Addr{HardwareAddr: net.HardwareAddr{5, 4, 3, 2, 1}},
|
||||
Addr: raw.Addr{HardwareAddr: net.HardwareAddr{5, 4, 3, 2, 1}},
|
||||
yiaddr: net.IP{4, 3, 2, 1},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue