]> xenbits.xensource.com Git - libvirt.git/commit
Log an error on attempts to add a NAT rule for non-IPv4 addresses
authorLaine Stump <laine@laine.org>
Tue, 4 Jan 2011 17:31:40 +0000 (12:31 -0500)
committerLaine Stump <laine@laine.org>
Wed, 5 Jan 2011 16:59:47 +0000 (11:59 -0500)
commitcd6a8f9ce2f365115da7fa5902c7e14d9ed941bc
tree68ba9f7dc0792a45210451733c896d1106528207
parent6741ca36bd260691362c3198b59554855e879f8c
Log an error on attempts to add a NAT rule for non-IPv4 addresses

Although the upper-layer code protected against it, it was possible to
call iptablesForwardMasquerade() with an IPv6 address and have it
attempt to add a rule to the MASQUERADE chain of ip6tables (which
doesn't exist).

This patch changes that function to check the protocol of the given
address, generate an error log if it's not IPv4 (AF_INET), and finally
hardcodes all the family parameters sent down to lower-level functions.
src/util/iptables.c