]> xenbits.xensource.com Git - libvirt.git/commit
Avoid integer wrap on remotePortMax in QEMU driver
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 17 Jan 2013 12:07:53 +0000 (12:07 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 17 Jan 2013 13:52:33 +0000 (13:52 +0000)
commitda5a8aee2b20f207bf30ceb9ca182e42ff3903ea
treebc9cd4a74fbc2d21637bb49addde51f42cf23754
parent4909bcbbc12c825ed234982b980ddf0154acb923
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.
src/qemu/qemu_conf.c
src/util/virportallocator.c
tests/virportallocatortest.c