summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_root_path.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/option_root_path.go')
-rw-r--r--dhcpv4/option_root_path.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/dhcpv4/option_root_path.go b/dhcpv4/option_root_path.go
index 504ed17..ba6f03f 100644
--- a/dhcpv4/option_root_path.go
+++ b/dhcpv4/option_root_path.go
@@ -15,19 +15,7 @@ type OptRootPath struct {
// ParseOptRootPath constructs an OptRootPath struct from a sequence of bytes
// and returns it, or an error.
func ParseOptRootPath(data []byte) (*OptRootPath, error) {
- // Should at least have code and length
- if len(data) < 2 {
- return nil, ErrShortByteStream
- }
- code := OptionCode(data[0])
- if code != OptionRootPath {
- return nil, fmt.Errorf("expected option %v, got %v instead", OptionRootPath, code)
- }
- length := int(data[1])
- if len(data) < 2+length {
- return nil, ErrShortByteStream
- }
- return &OptRootPath{Path: string(data[2 : 2+length])}, nil
+ return &OptRootPath{Path: string(data)}, nil
}
// Code returns the option code.