[libvirt] [PATCHv2 10/13] Support multiple IP addresses on one network in bridge_driver.c
Eric Blake
eblake at redhat.com
Thu Dec 23 17:26:03 UTC 2010
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 at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101223/1a63911a/attachment-0001.sig>
More information about the libvir-list
mailing list