Skip to content

Commit

Permalink
ndp: modify NewCaptivePortal error text
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Layher <mdlayher@gmail.com>
  • Loading branch information
mdlayher committed Mar 23, 2022
1 parent 08de97e commit 0da72a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func NewCaptivePortal(uri string) (*CaptivePortal, error) {

// Try to comply with the max limit for DHCPv4.
if len(uri) > 255 {
return nil, errors.New("ndp: Captive-Portal option URI is too long")
return nil, errors.New("ndp: captive portal option URI is too long")
}

// TODO(mdlayher): a URN is almost a URL, but investigate compliance with
Expand All @@ -691,7 +691,7 @@ func NewCaptivePortal(uri string) (*CaptivePortal, error) {
// kind of path appended.
for _, s := range strings.Split(urn.Path, "/") {
if ip, err := netip.ParseAddr(s); err == nil {
return nil, fmt.Errorf("ndp: Captive-Portal option URIs should not contain IP addresses: %s", ip)
return nil, fmt.Errorf("ndp: captive portal option URIs should not contain IP addresses: %s", ip)
}
}

Expand Down

0 comments on commit 0da72a5

Please sign in to comment.