On 12/22/2010 11:58 AM, Laine Stump wrote:
This patch reorganizes the code in bridge_driver.c to account for
the
concept of a single network with multiple IP addresses, without adding
in the extra variable of IPv6. A small bit of code has been
temporarily added that checks all given addresses to verify they are
IPv4 - this will be removed when full IPv6 support is turned on.
@@ -747,23 +792,56 @@ networkAddRoutingIptablesRules(struct
network_driver *driver,
return 0;
-
- routeerr2:
+routeerr2:
Interesting mix of formatting changes as well as refactoring, but not
enough of an issue to insist on splitting this into two patches.
+static int
+networkAddIpSpecificIptablesRules(struct network_driver *driver,
+ virNetworkObjPtr network,
+ virNetworkIpDefPtr ipdef)
+{
+ if (network->def->forwardType == VIR_NETWORK_FORWARD_NAT &&
+ networkAddMasqueradingIptablesRules(driver, network, ipdef) < 0)
+ return -1;
+ else if (network->def->forwardType == VIR_NETWORK_FORWARD_ROUTE &&
Technically, the else is not necessary since the previous condition
returns. But it doesn't bother me to keep it in place.
ACK.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org