aboutsummaryrefslogtreecommitdiffstats
path: root/test/patches
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-17 17:53:44 -0500
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-18 20:42:36 +0000
commit53131d2a2667a28b64d8a862d070b6402e7732bb (patch)
tree336dfbf806ef43fcac1e557f20081fbe7e5fadf6 /test/patches
parent917c91ada5c2f5dd6c9dfc1070c0d8bc781ffd3b (diff)
tests: fix cdp patch for scapy 2.4.3
Type: test Fixes: 5d4b8912d2fe186b4fb920a72b3a2f7b556f4e7d Change-Id: Ib64ae00eba41b2b6afc728142cbccc02d07f4997 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/patches')
-rw-r--r--test/patches/scapy-2.4.3/cdp.patch22
1 files changed, 2 insertions, 20 deletions
diff --git a/test/patches/scapy-2.4.3/cdp.patch b/test/patches/scapy-2.4.3/cdp.patch
index de16f5d5079..8f2118b2f42 100644
--- a/test/patches/scapy-2.4.3/cdp.patch
+++ b/test/patches/scapy-2.4.3/cdp.patch
@@ -1,26 +1,8 @@
diff --git a/scapy/contrib/cdp.py b/scapy/contrib/cdp.py
-index c8b7f106..7b1ff64d 100644
+index 9ad15c8a..d9cd08c6 100644
--- a/scapy/contrib/cdp.py
+++ b/scapy/contrib/cdp.py
-@@ -102,7 +102,8 @@ def _CDPGuessPayloadClass(p, **kargs):
- class CDPMsgGeneric(Packet):
- name = "CDP Generic Message"
- fields_desc = [ XShortEnumField("type", None, _cdp_tlv_types),
-- FieldLenField("len", None, "val", "!H"),
-+ FieldLenField("len", None, "val", "!H",
-+ adjust=lambda pkt, x: x + 4),
- StrLenField("val", "", length_from=lambda x:x.len - 4) ]
-
-
-@@ -178,5 +179,6 @@ class CDPMsgAddr(CDPMsgGeneric):
- class CDPMsgPortID(CDPMsgGeneric):
- name = "Port ID"
- fields_desc = [ XShortEnumField("type", 0x0003, _cdp_tlv_types),
-- FieldLenField("len", None, "iface", "!H"),
-+ FieldLenField("len", None, "iface", "!H",
-+ adjust=lambda pkt, x: x + 4),
- StrLenField("iface", "Port 1", length_from=lambda x:x.len - 4) ]
-@@ -319,7 +319,7 @@ class _CDPChecksum:
+@@ -357,7 +357,7 @@ class _CDPChecksum:
This padding is only used for checksum computation. The original
packet should not be altered."""
if len(pkt) % 2: