Skip to content

Commit 0ce7d2d

Browse files
authored
Rename IPPrefix -> CDPPrefix
1 parent e6bb045 commit 0ce7d2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scapy/contrib/cdp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,19 +250,22 @@ class CDPMsgIPGateway(CDPMsgGeneric):
250250
IPField("defaultgw", "192.168.0.1")]
251251

252252

253-
class IPPrefix(CDPMsgGeneric):
253+
class CDPIPPrefix(Packet):
254254
fields_desc = [
255255
IPField("prefix", "192.168.0.1"),
256256
ByteField("plen", 24),
257257
]
258258

259+
def guess_payload_class(self, p):
260+
return conf.padding_layer
261+
259262

260263
class CDPMsgIPPrefix(CDPMsgGeneric):
261264
name = "IP Prefix"
262265
type = 0x0007
263266
fields_desc = [XShortEnumField("type", 0x0007, _cdp_tlv_types),
264267
ShortField("len", 9),
265-
PacketListField("prefixes", [], IPPrefix,
268+
PacketListField("prefixes", [], CDPIPPrefix,
266269
length_from=lambda p: p.len - 4)]
267270

268271

0 commit comments

Comments
 (0)