diff --git a/dhcp/dhcp.go b/dhcp/dhcp.go index cb9113d..445f8f2 100644 --- a/dhcp/dhcp.go +++ b/dhcp/dhcp.go @@ -283,6 +283,7 @@ func Unmarshal(bs []byte) (*Packet, error) { return nil, errors.New("packet has no DHCP Message Type") } ret.Type = MessageType(typ) + delete(ret.Options, 53) switch ret.Type { case MsgDiscover, MsgRequest, MsgDecline, MsgRelease, MsgInform: if bs[0] != 1 { diff --git a/dhcp/testdata/dhcp.parsed b/dhcp/testdata/dhcp.parsed index 9f84201..9a22db9 100644 --- a/dhcp/testdata/dhcp.parsed +++ b/dhcp/testdata/dhcp.parsed @@ -11,7 +11,6 @@ DHCPDISCOVER BootFilename: Options: - 53: []byte{0x1} 55: []byte{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0xb, 0xc, 0xd, 0xf, 0x10, 0x11, 0x12, 0x16, 0x17, 0x1c, 0x28, 0x29, 0x2a, 0x2b, 0x32, 0x33, 0x36, 0x3a, 0x3b, 0x3c, 0x42, 0x43, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87} 57: []byte{0x4, 0xec} 60: []byte{0x50, 0x58, 0x45, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x41, 0x72, 0x63, 0x68, 0x3a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3a, 0x55, 0x4e, 0x44, 0x49, 0x3a, 0x30, 0x30, 0x32, 0x30, 0x30, 0x31} @@ -33,7 +32,6 @@ DHCPOFFER Options: 43: []byte{0x6, 0x1, 0x3, 0x8, 0x7, 0x80, 0x0, 0x1, 0xc0, 0xa8, 0x10, 0xa, 0x9, 0xc, 0x80, 0x0, 0x9, 0x50, 0x69, 0x78, 0x69, 0x65, 0x63, 0x6f, 0x72, 0x65, 0xa, 0xa, 0x0, 0x50, 0x69, 0x78, 0x69, 0x65, 0x63, 0x6f, 0x72, 0x65, 0xff} - 53: []byte{0x2} 54: []byte{0xc0, 0xa8, 0x10, 0xa} 60: []byte{0x50, 0x58, 0x45, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74} 97: []byte{0x0, 0x0, 0x2, 0x0, 0x3, 0x0, 0x4, 0x0, 0x5, 0x0, 0x6, 0x0, 0x7, 0x0, 0x8, 0x0, 0x9} @@ -58,7 +56,6 @@ DHCPOFFER 15: []byte{0x68, 0x6f, 0x6d, 0x65, 0x2e, 0x75, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x74, 0x66} 28: []byte{0xc0, 0xa8, 0x10, 0xff} 51: []byte{0x0, 0x0, 0xe, 0x10} - 53: []byte{0x2} 54: []byte{0xc0, 0xa8, 0x10, 0x1} 58: []byte{0x0, 0x0, 0x7, 0x8} 59: []byte{0x0, 0x0, 0xc, 0x4e}