blob: 8fa9f69cc80a0f57703cfd0338ea260e894ed59c [file] [log] [blame]
Dave Wallacecf9356d2024-07-23 01:28:19 -04001diff --git a/scapy/contrib/cdp.py b/scapy/contrib/cdp.py
2index a1532b78..83963ff4 100644
3--- a/scapy/contrib/cdp.py
4+++ b/scapy/contrib/cdp.py
5@@ -392,7 +392,7 @@ class _CDPChecksum:
6 This padding is only used for checksum computation. The original
7 packet should not be altered."""
8 if len(pkt) % 2:
9- last_chr = orb(pkt[-1])
10+ last_chr = orb(pkt[len(pkt)-1:])
11 if last_chr <= 0x80:
12 return pkt[:-1] + b'\x00' + chb(last_chr)
13 else:
14