mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Avoid integer wrap on remotePortMax in QEMU driver
The QEMU driver default max port is 65535, but it then increments this by 1 to 65536. This maps to 0 in an unsigned short :-( This was apparently done so that for() loops could use "< max" instead of "<= max". Remove this insanity and just make the loop do the right thing.
This commit is contained in:
@@ -59,7 +59,7 @@ int bind(int sockfd ATTRIBUTE_UNUSED,
|
||||
|
||||
static int testAllocAll(const void *args ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virPortAllocatorPtr alloc = virPortAllocatorNew(5900, 5910);
|
||||
virPortAllocatorPtr alloc = virPortAllocatorNew(5900, 5909);
|
||||
int ret = -1;
|
||||
unsigned short p1, p2, p3, p4, p5, p6, p7;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user