summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-01-31 17:42:23 -0500
committerRussell Bryant <rbryant@redhat.com>2012-01-31 20:30:50 -0500
commit014f67a2769720f4833bba74343cedf0e894151c (patch)
tree7d0a359aa24a61c8b59fe4296dd25c54d95c8140 /nova/utils.py
parent79746bbe5281f950ffd46310867c90423ee286b3 (diff)
downloadnova-014f67a2769720f4833bba74343cedf0e894151c.tar.gz
nova-014f67a2769720f4833bba74343cedf0e894151c.tar.xz
nova-014f67a2769720f4833bba74343cedf0e894151c.zip
Fix VPN ping packet length.
Fix bug 906346. This patch addresses the typo pointed out in bug 906346. The ping being sent was 15 bytes long when it should have been 14. Removing a pad byte from the format string resolves this issue. I verified that the format described in the code comments (and now the code) was correct using an OpenVPN connection setup packet capture. Change-Id: Idbc5e48ede4a8d2836dd1b102a9a0e172540776c
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 791c63167..c1df317a1 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -128,7 +128,7 @@ def vpn_ping(address, port, timeout=0.05, session_id=None):
if session_id is None:
session_id = random.randint(0, 0xffffffffffffffff)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- data = struct.pack('!BQxxxxxx', 0x38, session_id)
+ data = struct.pack('!BQxxxxx', 0x38, session_id)
sock.sendto(data, (address, port))
sock.settimeout(timeout)
try: