From 2943f69fe4277297a362c156611e9ccc712e834b Mon Sep 17 00:00:00 2001 From: Anatole Denis Date: Thu, 3 Oct 2019 22:51:19 +0200 Subject: iana: HWType is 16 bits In both ARP and DHCPv6, the hwtype field is 16bits, and the IANA table has allocated values >255. (Bootp however uses 1byte so it can't represent everything) This was discovered by fuzzing, as it causes round-trip mismatches; eg with this packet (quoted string): "0000\x00\x01\x00\x0e\x00\x01000000000000" Input: 303030300001000e0001303030303030303030303030 Round-trip: 303030300001000e0001003030303030303030303030 ^ The upper byte of the hwaddress is set to 0 Signed-off-by: Anatole Denis --- iana/hwtypes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iana') diff --git a/iana/hwtypes.go b/iana/hwtypes.go index bbb3188..e6fb38b 100644 --- a/iana/hwtypes.go +++ b/iana/hwtypes.go @@ -1,7 +1,7 @@ package iana // HWType is a hardware type as per RFC 2132 and defined by the IANA. -type HWType uint8 +type HWType uint16 // See IANA for values. const ( -- cgit v1.2.3