Re: [PATCH 1/1] totemip: Fix possible error binding ip address(v1.4.7)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/06/15 06:12, Lidong Zhong wrote:
>>>> On 6/18/2015 at 10:03 PM, in message <5582CFA1.1040105@xxxxxxxxxx>, Christine
> Caulfield <ccaulfie@xxxxxxxxxx> wrote: 
>> On 18/06/15 03:20, Lidong Zhong wrote: 
>>> Hi Christine, 
>>>  
>>> Any news about this patch? 
>>>  
>>  
>> Hi Lidong, 
>>  
> Hi Christine, 
> 
> Thanks for your reply.
> 
>> I'm afraid I'm going to have to NAK it. Although it technically matches 
>> the man page, it breaks existing behaviour (the ability to bind to a 
>> host IP address) and that behaviour is also valid in corosync 2. If you 
>> can come up with a patch that allows that behaviour AND fixes this 
>> problem then I'll he happy to review it. 
>>  
> I think the condition you described here has already been considered in the original logic.
> The code is here
> 611                 if (tb[IFA_LOCAL]) {
> 612                     memcpy(ipaddr.addr, RTA_DATA(tb[IFA_LOCAL]), TOTEMIP_ADDRLEN);
> 613                     if (totemip_equal(&ipaddr, bindnet)) {
> 614                         found_if = 1;
> 615                         exact_match_found = 1;
> 616                     }
> 617                 }
> Then it will check if the bindnetwork address with netmask.
> 

You are correct, I took the time to test it today :)

It's been such a long time since that code was looked at, I'd forgotten
how that bit worked.

I'll check it into the flatiron branch, but it's unlikely to make RHEL
unless there's a compelling bugzilla to go with it.

Thanks for being persistent and patient.
Chrissie


> Regards,
> Lidong
> 
>> Sorry for delay in responding, I was away for a while. 
>>  
>> Chrissie 
>>  
>>> Regards, 
>>> Lidong 
>>>  
>>>>>> On 5/15/2015 at 09:52 AM, in  
>>>> message  
>>> <5555C1E0020000E100024737@xxxxxxxxxxxxxxxxxxxxxxx>, "Lidong  
>>>> Zhong"  
>>> <lzhong@xxxxxxxx> wrote:  
>>>  On 5/14/2015 at 08:23 PM, in message  
>>>> <555493A5.6070004@xxxxxxxxxx>, Christine  
>>>> Caulfield <ccaulfie@xxxxxxxxxx> wrote:   
>>>>> On 14/05/15 06:36, Lidong Zhong wrote:   
>>>>>> For instance, the IPs are:   
>>>>>> eth0: 10.150.10.81/8   
>>>>>> eth1: 10.150.10.91/24    
>>>>>> The bindnetaddr in corosync is: 10.150.10.0 and the addr of eth1 is   
>>>>>> selected in UDPU mode. Then the bindto address probably mistakenly choose   
>>>>>> the addr of eth0.   
>>>>>>    
>>>>>    
>>>>> Hiya,   
>>>>>    
>>>>> Thanks for the patch but I'm not convinced it's the right thing to do   
>>>>> for all situations. If the bindnet_addr is set to an actual IP address   
>>>>> and not a subnet mask then it will fail I think. What does your   
>>>>> corosync.conf look like?   
>>>>>    
>>>> Hi Chrissie,  
>>>>   
>>>> Thanks for your reply. The full corosync.conf is attached below.  
>>>> As the man page says, the bindnetaddr always is the local interface ip  
>>>> with netmask. It should be a full ip address only in IPv6 case. And I think  
>>   
>>>> there  
>>>> is no problem for the current code to handle IPv6 address.  
>>>>   
>>>> Regards,  
>>>> Lidong  
>>>>   
>>>>> Chrissie   
>>>>>    
>>>>>> Signed-off-by: Lidong Zhong <lzhong@xxxxxxxx>   
>>>>>> ---   
>>>>>>  exec/totemip.c | 2 +-   
>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)   
>>>>>>    
>>>>>> diff --git a/exec/totemip.c b/exec/totemip.c   
>>>>>> index ab175a8..c1fa800 100644   
>>>>>> --- a/exec/totemip.c   
>>>>>> +++ b/exec/totemip.c   
>>>>>> @@ -626,7 +626,7 @@ int totemip_iface_check(struct totem_ip_address    
>>>>> *bindnet,   
>>>>>>  					memcpy(&network, RTA_DATA(tb[IFA_LOCAL]), sizeof(uint32_t));   
>>>>>>  					memcpy(&addr, bindnet->addr, sizeof(uint32_t));   
>>>>>>     
>>>>>> -					if ((addr & netmask) == (network & netmask)) {   
>>>>>> +					if (addr == (network & netmask)) {   
>>>>>>  						memcpy(ipaddr.addr, RTA_DATA(tb[IFA_ADDRESS]), TOTEMIP_ADDRLEN);   
>>>>>>  						found_if = 1;   
>>>>>>  					}   
>>>>>>    
>>>>>    
>>>>> _______________________________________________   
>>>>> discuss mailing list   
>>>>> discuss@xxxxxxxxxxxx   
>>>>> http://lists.corosync.org/mailman/listinfo/discuss   
>>>>>    
>>>>>    
>>>>   
>>>>   
>>>>   
>>>  
>>>  
>>  
>>  
>>  
> 

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss



[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux