Problem with ctdb_sys_have_ip

miguel.sanders at arcelormittal.com miguel.sanders at arcelormittal.com
Fri Aug 28 11:54:59 MDT 2009


Hi

I think I already reported something similar in the past.

http://lists.samba.org/archive/samba-technical/2009-June/065100.html 


Met vriendelijke groet
Best regards
Bien à vous

Miguel SANDERS
ArcelorMittal Gent

UNIX Systems & Storage
IT Supply Western Europe | John Kennedylaan 51
B-9042 Gent

T +32 9 347 3538 | F +32 9 347 4901 | M +32478 805 023
E miguel.sanders at arcelormittal.com
www.arcelormittal.com/gent

-----Oorspronkelijk bericht-----
Van: samba-technical-bounces at lists.samba.org [mailto:samba-technical-bounces at lists.samba.org] Namens ronnie sahlberg
Verzonden: vrijdag 28 augustus 2009 19:20
Aan: Harald Klatte
CC: samba-technical at lists.samba.org
Onderwerp: Re: Problem with ctdb_sys_have_ip

On Sat, Aug 29, 2009 at 2:58 AM, Harald Klatte<klatte at hrz.uni-kassel.de> wrote:
>
> Hi,
>
> testing ctdb on AIX (not on Linux) I detected a misbehaviour:
> Ctdb tries to take over IP Adresses, even if they are still configured 
> according to ifconfig.
>
> I determined the function "ctdb_sys_have_ip" in system_common.c as the cause.
> It always returns false no matter if the concerning address is configured or not.
>
> I wound up with inserting a debug line into the code:
>
>
> /*
>  see if we currently have an interface with the given IP
>
>  we try to bind to it, and if that fails then we don't have that IP
>  on an interface
>  */
> bool ctdb_sys_have_ip(ctdb_sock_addr *_addr) {
>        int s;
>        int ret;
>        ctdb_sock_addr __addr = *_addr;
>        ctdb_sock_addr *addr = &__addr;
>
>        switch (addr->sa.sa_family) {
>        case AF_INET:
>                addr->ip.sin_port = 0;

Can you try adding this code  at this point :
#ifdef HAVE_SOCK_SIN_LEN
	          addr->ip.sin_len = sizeof(addr->ip); #endif


>                break;
>        case AF_INET6:
>                addr->ip6.sin6_port = 0;
>                break;
>        }
>
>        s = socket(addr->sa.sa_family, SOCK_STREAM, 
> htons(IPPROTO_TCP));
>        if (s == -1) {
>                return false;
>        }
>
>        ret = bind(s, (struct sockaddr *)addr, sizeof(*addr));
>        if (ret == -1) {
>                DEBUG(DEBUG_CRIT,("  !! failed to bind address to 
> socket (%s)\n", strerror(errno) ));
>                return false;
>        }
>
>        close(s);
>        return ret == 0;
> }
>
>
> Syslog shows:
>
> 2009/08/28 18:19:15.730807 [188748]: server/ctdb_recoverd.c:1541 
> Recovery - disabled recovery mode
> 2009/08/28 18:19:15.730894 [188748]: Deterministic IPs enabled. 
> Resetting all ip allocations
> 2009/08/28 18:19:15.731116 [147676]:   !! failed to bind address to 
> socket (Invalid argument)
> 2009/08/28 18:19:15.731210 [147676]: Takeover of IP xx.xx.xx.xx/24 on 
> interface en1
> 2009/08/28 18:19:15.731891 [147676]:   !! failed to bind address to 
> socket (Invalid argument)
> 2009/08/28 18:19:15.731980 [147676]: Takeover of IP xx.xx.xx.xx/24 on 
> interface en1
> 2009/08/28 18:19:15.733006 [188748]: server/ctdb_recoverd.c:1552 
> Recovery - takeip finished
> 2009/08/28 18:19:15.733140 [147676]: Recovery has finished
>
>
> this shows EINVAL while there is no obviously wrong data type.
>
> Has someone seen this fault before?
> Where can be the problem?
>
>
> Thanks
>
> Harald
>
>
> --
>
> +----------+  Harald Klatte                       email: 
> +----------+ klatte at hrz.uni-kassel.de
> |Uni-Kassel|  ITS,  Universitaet Kassel                   Tel.: (49) 
> |Uni-Kassel| 561/804-2280
> +----------+  Moenchebergstr. 11, 34109 Kassel            Fax:  (49) 
> +----------+ 561/804-2297
>
>

**** 
This message and any attachment are confidential, intended solely for the use of the individual or entity to whom it is addressed and may be protected by professional secrecy or intellectual property rights. 
If you have received it by mistake, or are not the named recipient(s), please immediately notify the sender and delete the message. You are hereby notified that any unauthorized use, copying or dissemination of any or all information contained in this message is prohibited. 
Arcelormittal shall not be liable for the message if altered, falsified, or in case of error in the recipient. 
This message does not constitute any right or commitment for ArcelorMittal except when expressly agreed otherwise in writing in a separate agreement.  
****  



More information about the samba-technical mailing list