Skip to content

Commit

Permalink
dhcpd: imp names, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Sep 13, 2022
1 parent 600d63d commit a36d70d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/dhcpd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ type V4ServerConf struct {
// errNilConfig is an error returned by validation method if the config is nil.
const errNilConfig errors.Error = "nil config"

// tryTo4 returns a 4-byte version of ip. An error is returned if the passed ip
// is not an IPv4.
func tryTo4(ip net.IP) (ip4 net.IP, err error) {
// ensureV4 returns a 4-byte version of ip. An error is returned if the passed
// ip is not an IPv4.
func ensureV4(ip net.IP) (ip4 net.IP, err error) {
if ip == nil {
return nil, fmt.Errorf("%v is not an IP address", ip)
}
Expand All @@ -140,7 +140,7 @@ func (c *V4ServerConf) Validate() (err error) {
}

var gatewayIP net.IP
gatewayIP, err = tryTo4(c.GatewayIP)
gatewayIP, err = ensureV4(c.GatewayIP)
if err != nil {
// Don't wrap an errors since it's inforative enough as is and there is
// an annotation deferred already.
Expand Down
4 changes: 2 additions & 2 deletions internal/dhcpd/http_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type jsonError struct {
Message string `json:"message"`
}

// notImplemented returns a handler that replies to any request with an HTTP 501
// Not Implemented status and a JSON error with the provided message msg.
// notImplemented is a handler that replies to any request with an HTTP 501 Not
// Implemented status and a JSON error with the provided message msg.
//
// TODO(a.garipov): Either take the logger from the server after we've
// refactored logging or make this not a method of *Server.
Expand Down

0 comments on commit a36d70d

Please sign in to comment.