Skip to content

Commit

Permalink
dhcpsvc: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Dec 8, 2023
1 parent 2949544 commit 71233b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions internal/dhcpsvc/v4.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type IPv4Config struct {
RangeEnd netip.Addr

// Options is the list of DHCP options to send to DHCP clients. The options
// with zero length are treated as deletions of the corresponding options,
// either implicit or explicit.
// having a zero value within the Length field are treated as deletions of
// the corresponding options, either implicit or explicit.
Options layers.DHCPOptions

// LeaseDuration is the TTL of a DHCP lease.
Expand Down Expand Up @@ -130,6 +130,8 @@ func newIface4(name string, conf *IPv4Config) (i *iface4, err error) {
// options returns the implicit and explicit options for the interface. The two
// lists are disjoint and the implicit options are initialized with default
// values.
//
// TODO(e.burkov): DRY with the IPv6 version.
func (conf *IPv4Config) options() (implicit, explicit layers.DHCPOptions) {
// Set default values of host configuration parameters listed in Appendix A
// of RFC-2131. Keep the list sorted by option code for using the binary
Expand Down Expand Up @@ -306,8 +308,8 @@ func (conf *IPv4Config) options() (implicit, explicit layers.DHCPOptions) {
}
}

log.Debug("dhcpv4: implicit options: %s", implicit)
log.Debug("dhcpv4: explicit options: %s", explicit)
log.Debug("dhcpsvc: v4: implicit options: %s", implicit)
log.Debug("dhcpsvc: v4: explicit options: %s", explicit)

return implicit, explicit
}
Expand Down
4 changes: 2 additions & 2 deletions internal/dhcpsvc/v6.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func (conf *IPv6Config) options() (implicit, explicit layers.DHCPv6Options) {
explicit = append(explicit, exp)
}

log.Debug("dhcpv6: implicit options: %s", implicit)
log.Debug("dhcpv6: explicit options: %s", explicit)
log.Debug("dhcpsvc: v6: implicit options: %s", implicit)
log.Debug("dhcpsvc: v6: explicit options: %s", explicit)

return implicit, explicit
}
Expand Down

0 comments on commit 71233b9

Please sign in to comment.