On 02/12/2011 04:17 PM, David Ward wrote:
> Daniel,
>
> On 02/06/2010 03:29 PM, Daniel Lezcano wrote:
>> diff --git a/src/lxc/confile.c b/src/lxc/confile.c
>> index 4d81ac6..7c72752 100644
>> --- a/src/lxc/confile.c
>> +++ b/src/lxc/confile.c
>> @@ -423,9 +423,8 @@ static int config_network_ipv4(const char *key, 
>> char *value,
>>      * prefix and address
>>      */
>>      if (!bcast) {
>> -        inetdev->bcast.s_addr =
>> -            htonl(INADDR_BROADCAST<<  (32 - inetdev->prefix));
>> -        inetdev->bcast.s_addr&= inetdev->addr.s_addr;
>> +        int mask = htonl(INADDR_BROADCAST<<  (32 - inetdev->prefix));
>> +        inetdev->bcast.s_addr = (inetdev->addr.s_addr&  mask) | ~mask;
>>      }
>>
>>      lxc_list_add(&netdev->ipv4, list);
>
>
> The following would be a lot simpler:
>
> inetdev->bcast.s_addr = inetdev->addr.s_addr;
> inetdev->bcast.s_addr |= htonl(INADDR_BROADCAST>>  inetdev->prefix);

Right :)

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to