[libvirt] [PATCHv2 10/13] Support multiple IP addresses on one network in bridge_driver.c
Laine Stump
laine at laine.org
Thu Dec 23 18:51:53 UTC 2010
On 12/23/2010 12:26 PM, Eric Blake wrote:
> 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.
Many of those are due to ctl-X ctl-Q in emacs after doing a block copy.
Most of these functions I approached by rewriting them "from scratch",
using chunks of the existing functions as a model, in some cases copying
them, and in other cases rewriting from scratch.
>> +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.
I'll remove it anyway (of course it's going to change in a subsequent
patch ;-)
> ACK.
>
More information about the libvir-list
mailing list