On 05/14/2013 03:10 PM, Laine Stump wrote:
On 05/14/2013 03:58 PM, Stefan Berger wrote:
> Linux netfilter at some point (Linux 2.6.39) inverted the meaning of the
> '--ctdir reply' and newer netfilter implementations now expect
> '--ctdir original' instead and vice-versa.
> We check for the kernel version and assume that all Linux kernels with version
> 2.6.39 have the newer inverted logic.
>
> +
> + /* following Linux lxr, the logic was inverted in 2.6.39 */
> + if (sscanf(utsname.release, "%u.%u.%u", &major, &minor,
µ) != 3) {
Since these functions are only ever compiled on Linux, I think it's fine
that you're only checking release, and not looking at sysname (we
already know what it is.
I'm not a fan of sscanf(), and would prefer it was completely eliminated
from libvirt, but it is still in use in a few places, so I guess this
could go in too. But I would prefer something similar to the way we
parse the qemu version number at the top of virQEMUCapsParseHelpStr().
Use virParseVersionString (search for "uts\.release" in
tools/virt-host-validate-common.c for an example usage).
Does anyone else have an opinion one way or another on sscanf?
At any rate, ACK either way.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org