diff --git a/go.mod b/go.mod index 38144446..709c78b8 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/google/gopacket v1.1.19 github.com/google/renameio v1.0.1 github.com/google/uuid v1.3.0 - github.com/insomniacslk/dhcp v0.0.0-20221215072855-de60144f33f8 + github.com/insomniacslk/dhcp v0.0.0-20230516061539-49801966e6cb github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 github.com/kardianos/service v1.2.2 github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 diff --git a/go.sum b/go.sum index 50fe3c85..f0baaf4f 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 h1:/jC7qQFrv8 github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714/go.mod h1:2Goc3h8EklBH5mspfHFxBnEoURQCGzQQH1ga9Myjvis= github.com/insomniacslk/dhcp v0.0.0-20221215072855-de60144f33f8 h1:Z72DOke2yOK0Ms4Z2LK1E1OrRJXOxSj5DllTz2FYTRg= github.com/insomniacslk/dhcp v0.0.0-20221215072855-de60144f33f8/go.mod h1:m5WMe03WCvWcXjRnhvaAbAAXdCnu20J5P+mmH44ZzpE= +github.com/insomniacslk/dhcp v0.0.0-20230516061539-49801966e6cb h1:6fDKEAXwe3rsfS4khW3EZ8kEqmSiV9szhMPcDrD+Y7Q= +github.com/insomniacslk/dhcp v0.0.0-20230516061539-49801966e6cb/go.mod h1:7474bZ1YNCvarT6WFKie4kEET6J0KYRDC4XJqqXzQW4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= diff --git a/internal/aghnet/dhcp_unix.go b/internal/aghnet/dhcp_unix.go index 16c3c87a..cb44e29d 100644 --- a/internal/aghnet/dhcp_unix.go +++ b/internal/aghnet/dhcp_unix.go @@ -304,7 +304,7 @@ func tryConn6(req *dhcpv6.Message, c net.PacketConn) (ok, next bool, err error) if !(response.Type() == dhcpv6.MessageTypeAdvertise && msg.TransactionID == req.TransactionID && rcid != nil && - cid.Equal(*rcid)) { + cid.Equal(rcid)) { log.Debug("dhcpv6: received message from server doesn't match our request") diff --git a/internal/dhcpd/v6_unix.go b/internal/dhcpd/v6_unix.go index cbe67eaa..e192e58a 100644 --- a/internal/dhcpd/v6_unix.go +++ b/internal/dhcpd/v6_unix.go @@ -30,7 +30,7 @@ type v6Server struct { leasesLock sync.Mutex leases []*Lease ipAddrs [256]byte - sid dhcpv6.Duid + sid dhcpv6.DUID ra raCtx // RA module @@ -659,9 +659,8 @@ func (s *v6Server) Start() (err error) { return fmt.Errorf("validating interface %s: %w", iface.Name, err) } - s.sid = dhcpv6.Duid{ - Type: dhcpv6.DUID_LLT, - HwType: iana.HWTypeEthernet, + s.sid = &dhcpv6.DUIDLLT{ + HWType: iana.HWTypeEthernet, LinkLayerAddr: iface.HardwareAddr, Time: dhcpv6.GetTime(), } diff --git a/internal/dhcpd/v6_unix_test.go b/internal/dhcpd/v6_unix_test.go index c5034e47..3ed5221a 100644 --- a/internal/dhcpd/v6_unix_test.go +++ b/internal/dhcpd/v6_unix_test.go @@ -121,9 +121,8 @@ func TestV6GetLease(t *testing.T) { dnsAddr := net.ParseIP("2000::1") s.conf.dnsIPAddrs = []net.IP{dnsAddr} - s.sid = dhcpv6.Duid{ - Type: dhcpv6.DUID_LLT, - HwType: iana.HWTypeEthernet, + s.sid = &dhcpv6.DUIDLL{ + HWType: iana.HWTypeEthernet, LinkLayerAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, } @@ -216,9 +215,8 @@ func TestV6GetDynamicLease(t *testing.T) { dnsAddr := net.ParseIP("2000::1") s.conf.dnsIPAddrs = []net.IP{dnsAddr} - s.sid = dhcpv6.Duid{ - Type: dhcpv6.DUID_LLT, - HwType: iana.HWTypeEthernet, + s.sid = &dhcpv6.DUIDLL{ + HWType: iana.HWTypeEthernet, LinkLayerAddr: net.HardwareAddr{0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA}, }