diff --git a/scapy/layers/dhcp6.py b/scapy/layers/dhcp6.py index c55fb9f..0588867 100644 --- a/scapy/layers/dhcp6.py +++ b/scapy/layers/dhcp6.py @@ -894,13 +894,6 @@ class DHCP6OptRelayAgentERO(_DHCP6OptGuessPayload): # RFC4994 # INFORMATION REQUEST # - relay : RELAY-FORW (toward server) -class _DHCP6GuessPayload(Packet): - def guess_payload_class(self, payload): - if len(payload) > 1 : - print ord(payload[0]) - return get_cls(dhcp6opts.get(ord(payload[0]),"DHCP6OptUnknown"), conf.raw_layer) - return conf.raw_layer - ##################################################################### ## DHCPv6 messages sent between Clients and Servers (types 1 to 11) # Comme specifie en section 15.1 de la RFC 3315, les valeurs de @@ -1137,7 +1130,7 @@ class DHCP6_InfoRequest(DHCP6): # address or other multicast addresses, it sets the Hop Limit field to # 32. -class DHCP6_RelayForward(_DHCP6GuessPayload,Packet): +class DHCP6_RelayForward(_DHCP6OptGuessPayload,Packet): name = "DHCPv6 Relay Forward Message (Relay Agent/Server Message)" fields_desc = [ ByteEnumField("msgtype", 12, dhcp6types), ByteField("hopcount", None), diff --git a/test/regression.uts b/test/regression.uts index d8f9277..508877b 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -3737,6 +3737,11 @@ str(DHCP6_RelayForward()) == '\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x a=DHCP6_RelayForward('\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') a.msgtype == 12 and a.hopcount == 0 and a.linkaddr == "::" and a.peeraddr == "::" += DHCP6_RelayForward - Dissection with options +a = DHCP6_RelayForward('\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x04\x00\x01\x00\x00') +a.msgtype == 12 and DHCP6OptRelayMsg in a and DHCP6OptClientId in a + + ##################################################################### + Test DHCP6 Messages - DHCP6_RelayReply