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>
Fri, 8 May 2009 09:13:54 +0000 (11:13 +0200)
Michael

source/smbd/server.c

index 3f251d804a995cf98dbdb1b96716aaf5c32b73a3..67f528c8610e6d668d85d8f807e6948dbb26fe0b 100644 (file)
@@ -991,8 +991,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 -