Comment 1 for bug 906346

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 906346] [NEW] a mistake in nova/utils.py/vpn_ping

The code sends a fake handshake packet to a vpn server and waits for a valid repsonse. It allows us to programmatically check if a vpn is listening as it should.

On Dec 19, 2011, at 6:43 AM, can. wrote:

> Public bug reported:
>
> I'm just starting to read the source code of nova, but I believe someone has made a mistake.
> Because the comments and code don't match
>
> the comments:
> Client packet (14 bytes)::
> 0 1 8 9 13
> +-+--------+-----+
> |x| cli_id |?????|
> +-+--------+-----+
> x = packet identifier 0x38
> cli_id = 64 bit identifier
> ? = unknown, probably flags/padding
>
> the code:
>
> data = struct.pack('!BQxxxxxx', 0x38, session_id)
>
> where in the format string:
> ! for network(=big-endian)
> B for unsigned char, 1 byte
> Q for unsigned long long, 8 byte
> x for pad byte
>
> I think the format string !BQxxxxxx should be !BQxxxxx
>
> btw, I actually don't understand what this function do and the name 'vpn_ping' confuses me
> can anyone explain it?
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/906346
>
> Title:
> a mistake in nova/utils.py/vpn_ping
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> I'm just starting to read the source code of nova, but I believe someone has made a mistake.
> Because the comments and code don't match
>
> the comments:
> Client packet (14 bytes)::
> 0 1 8 9 13
> +-+--------+-----+
> |x| cli_id |?????|
> +-+--------+-----+
> x = packet identifier 0x38
> cli_id = 64 bit identifier
> ? = unknown, probably flags/padding
>
> the code:
>
> data = struct.pack('!BQxxxxxx', 0x38, session_id)
>
> where in the format string:
> ! for network(=big-endian)
> B for unsigned char, 1 byte
> Q for unsigned long long, 8 byte
> x for pad byte
>
> I think the format string !BQxxxxxx should be !BQxxxxx
>
> btw, I actually don't understand what this function do and the name 'vpn_ping' confuses me
> can anyone explain it?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova/+bug/906346/+subscriptions