s3: make release_ip() call (ctdb) cope with IPv4 mapped addresses
authorMichael Adam <obnox@samba.org>
Thu, 7 May 2009 23:11:43 +0000 (01:11 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 7 May 2009 23:18:58 +0000 (01:18 +0200)
Michael

source3/smbd/process.c

index 7605ad70b55782f87236d28992e5a01a306ce2a8..0f3e560611cc9676897214c51462d4e77a8add29 100644 (file)
@@ -1887,8 +1887,15 @@ received when we should release a specific IP
 static void release_ip(const char *ip, void *priv)
 {
        char addr[INET6_ADDRSTRLEN];
+       char *p;
 
-       if (strcmp(client_socket_addr(get_client_fd(),addr,sizeof(addr)), ip) == 0) {
+       client_socket_addr(get_client_fd(),addr,sizeof(addr));
+
+       if (strncmp("::ffff:", addr, 7) == 0) {
+               p = addr + 7;
+       }
+
+       if ((strcmp(p, ip) == 0) || (strcmp(addr, ip) == 0)) {
                /* we can't afford to do a clean exit - that involves
                   database writes, which would potentially mean we
                   are still running after the failover has finished -