blob: 8f2118b2f420628e472a2f88ce8c08aad70f37f1 [file] [log] [blame]
snaramre5d4b8912019-12-13 23:39:35 +00001diff --git a/scapy/contrib/cdp.py b/scapy/contrib/cdp.py
Paul Vinciguerra53131d22019-12-17 17:53:44 -05002index 9ad15c8a..d9cd08c6 100644
snaramre5d4b8912019-12-13 23:39:35 +00003--- a/scapy/contrib/cdp.py
4+++ b/scapy/contrib/cdp.py
Paul Vinciguerra53131d22019-12-17 17:53:44 -05005@@ -357,7 +357,7 @@ class _CDPChecksum:
snaramre5d4b8912019-12-13 23:39:35 +00006 This padding is only used for checksum computation. The original
7 packet should not be altered."""
8 if len(pkt) % 2:
9- last_chr = pkt[-1]
10+ last_chr = pkt[len(pkt)-1:]
11 if last_chr <= b'\x80':
12 return pkt[:-1] + b'\x00' + last_chr
13 else: