diff --git a/scapy/layers/dhcp6.py b/scapy/layers/dhcp6.py index 4cb929105015c4e3c93516b2daea888522e5365f..7980a51c761d8b81d912f159a8ed7526bb0918ed 100644 --- a/scapy/layers/dhcp6.py +++ b/scapy/layers/dhcp6.py @@ -694,13 +694,13 @@ class DHCP6OptIAPrefix(_DHCP6OptGuessPayload): #RFC3633 name = "DHCP6 Option - IA_PD Prefix option" fields_desc = [ ShortEnumField("optcode", 26, dhcp6opts), FieldLenField("optlen", None, length_of="iaprefopts", - adjust = lambda pkt,x: x+26), + adjust = lambda pkt,x: x+25), IntField("preflft", 0), IntField("validlft", 0), ByteField("plen", 48), # TODO: Challenge that default value IP6Field("prefix", "2001:db8::"), # At least, global and won't hurt StrLenField("iaprefopts", "", - length_from = lambda pkt: pkt.optlen-26) ] + length_from = lambda pkt: pkt.optlen-25) ] class DHCP6OptIA_PD(_DHCP6OptGuessPayload): #RFC3633 name = "DHCP6 Option - Identity Association for Prefix Delegation" diff --git a/test/regression.uts b/test/regression.uts index 6e0ba09c917d51bae312a198dd134339f741b813..b6fd6f085f4da75dd96bd65ebda4a6aecc6d37f8 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -3548,7 +3548,7 @@ a.optcode == 24 and a.optlen == 36 and len(a.dnsdomains) == 2 and a.dnsdomains[0 + Test DHCP6 Option - IA_PD Prefix Option = DHCP6OptIAPrefix - Basic Instantiation -str(DHCP6OptIAPrefix()) == '\x00\x1a\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x000 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' +str(DHCP6OptIAPrefix()) == '\x00\x1a\x00\x19\x00\x00\x00\x00\x00\x00\x00\x000 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' #TODO : finish me