53131d2a26
Type: test Fixes: 5d4b8912d2fe186b4fb920a72b3a2f7b556f4e7d Change-Id: Ib64ae00eba41b2b6afc728142cbccc02d07f4997 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
14 lines
509 B
Diff
14 lines
509 B
Diff
diff --git a/scapy/contrib/cdp.py b/scapy/contrib/cdp.py
|
|
index 9ad15c8a..d9cd08c6 100644
|
|
--- a/scapy/contrib/cdp.py
|
|
+++ b/scapy/contrib/cdp.py
|
|
@@ -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:
|
|
- last_chr = pkt[-1]
|
|
+ last_chr = pkt[len(pkt)-1:]
|
|
if last_chr <= b'\x80':
|
|
return pkt[:-1] + b'\x00' + last_chr
|
|
else:
|