summaryrefslogtreecommitdiffstats
path: root/test/patches/scapy-2.4.5/cdp.patch
blob: 8fa9f69cc80a0f57703cfd0338ea260e894ed59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/scapy/contrib/cdp.py b/scapy/contrib/cdp.py
index a1532b78..83963ff4 100644
--- a/scapy/contrib/cdp.py
+++ b/scapy/contrib/cdp.py
@@ -392,7 +392,7 @@ class _CDPChecksum:
         This padding is only used for checksum computation.  The original
         packet should not be altered."""
         if len(pkt) % 2:
-            last_chr = orb(pkt[-1])
+            last_chr = orb(pkt[len(pkt)-1:])
             if last_chr <= 0x80:
                 return pkt[:-1] + b'\x00' + chb(last_chr)
             else: