dhcspvc: imp docs

This commit is contained in:
Eugene Burkov 2026-07-27 16:38:51 +03:00
parent 9088177898
commit 55e177638c
3 changed files with 2 additions and 10 deletions

View file

@ -6,7 +6,6 @@ import (
"time"
"github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc"
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/testutil"
)
@ -150,8 +149,7 @@ func TestIPv6Config_Validate(t *testing.T) {
RangeStart: testIPv4Conf.GatewayIP,
LeaseDuration: 1 * time.Hour,
},
wantErrMsg: "range start: " + errors.ErrBadEnumValue.Error() + ": " +
testGatewayIPv4Str + ": must be a valid ipv6 address",
wantErrMsg: "range start: " + testGatewayIPv4Str + ": must be a valid ipv6",
}, {
name: "bad_lease_duration",
conf: &dhcpsvc.IPv6Config{

View file

@ -228,8 +228,6 @@ func (iface *netInterface) allocateLease(
// reserveLease reserves a lease for a client by its MAC-address. lease is nil
// if a new lease can't be allocated. mac must be a valid according to
// [netutil.ValidateMAC]. iface.indexMu mutex must be locked.
//
// TODO(e.burkov): Pass the time moment instead of clock.
func (iface *netInterface) reserveLease(
ctx context.Context,
mac net.HardwareAddr,

View file

@ -106,11 +106,7 @@ func (c *IPv6Config) Validate() (err error) {
}
if !c.RangeStart.Is6() {
errs = append(errs, fmt.Errorf(
"range start: %w: %s: must be a valid ipv6 address",
errors.ErrBadEnumValue,
c.RangeStart,
))
errs = append(errs, fmt.Errorf("range start: %s: must be a valid ipv6", c.RangeStart))
}
return errors.Join(errs...)