diff options
Diffstat (limited to 'dhcpv6/dhcpv6_test.go')
-rw-r--r-- | dhcpv6/dhcpv6_test.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6_test.go b/dhcpv6/dhcpv6_test.go index 210f19d..9ea61fa 100644 --- a/dhcpv6/dhcpv6_test.go +++ b/dhcpv6/dhcpv6_test.go @@ -273,3 +273,39 @@ func TestGetTransactionIDRelay(t *testing.T) { // TODO test NewMessageTypeSolicit // test String and Summary + +func FuzzDHCPv6(f *testing.F) { + + var relayForwBytesDuidUUID_data = []byte{ + 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x26, 0x8a, 0x07, 0xff, 0xfe, 0x56, + 0xdc, 0xa4, 0x00, 0x12, 0x00, 0x06, 0x24, 0x8a, + 0x07, 0x56, 0xdc, 0xa4, 0x00, 0x09, 0x00, 0x5a, + 0x06, 0x7d, 0x9b, 0xca, 0x00, 0x01, 0x00, 0x12, + 0x00, 0x04, 0xb7, 0xfd, 0x0a, 0x8c, 0x1b, 0x14, + 0x10, 0xaa, 0xeb, 0x0a, 0x5b, 0x3f, 0xe8, 0x9d, + 0x0f, 0x56, 0x00, 0x06, 0x00, 0x0a, 0x00, 0x17, + 0x00, 0x18, 0x00, 0x17, 0x00, 0x18, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x02, 0xff, 0xff, 0x00, 0x03, + 0x00, 0x28, 0x07, 0x56, 0xdc, 0xa4, 0x00, 0x00, + 0x0e, 0x10, 0x00, 0x00, 0x15, 0x18, 0x00, 0x05, + 0x00, 0x18, 0x26, 0x20, 0x01, 0x0d, 0xc0, 0x82, + 0x90, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xaf, 0xa0, 0x00, 0x00, 0x1c, 0x20, 0x00, 0x00, + 0x1d, 0x4c} + + f.Add(relayForwBytesDuidUUID_data) + f.Add([]byte{01, 0xab, 0xcd, 0xef, 0x00, 0x00, 0x00, 0x00}) + f.Add([]byte{01, 0xa, 0xb, 0xc, 0x00, 0x00, 0x00, 0x00}) + f.Add([]byte("0000\x00\x01\x00\x0e\x00\x01000000000000")) + + f.Fuzz(func(t *testing.T, data []byte) { + msg, err := FromBytes(data) + if err != nil { + return + } + msg.ToBytes() + }) +} |