aboutsummaryrefslogtreecommitdiffstats
path: root/test/patches/scapy-2.4.3/cdp.patch
blob: 8f2118b2f420628e472a2f88ce8c08aad70f37f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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: