From 014f67a2769720f4833bba74343cedf0e894151c Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 31 Jan 2012 17:42:23 -0500 Subject: 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 --- nova/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova') 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: -- cgit