#! /bin/sh /usr/share/dpatch/dpatch-run ## 001_ccs.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad redhat-cluster-suite-2.20070502~/ccs/ccs_tool/update.c redhat-cluster-suite-2.20070502/ccs/ccs_tool/update.c --- redhat-cluster-suite-2.20070502~/ccs/ccs_tool/update.c 2007-05-03 07:29:48.000000000 +0200 +++ redhat-cluster-suite-2.20070502/ccs/ccs_tool/update.c 2007-05-03 07:46:53.000000000 +0200 @@ -20,6 +20,12 @@ #include #include +#ifdef DEBUG +#include +#include +#include +#endif + #include "comm_headers.h" #include "ccs.h" #include "libcman.h" @@ -659,12 +665,43 @@ static int ccs_open(cman_node_t node, uint16_t port, int timeout) { struct in_addr *addr; - int fd; + struct in6_addr *addr6; + int fd, family; +#ifdef DEBUG + char buf[INET6_ADDRSTRLEN]; - addr = &(((struct sockaddr_in *)&(node.cn_address.cna_address))->sin_addr); + memset(buf, 0, sizeof(buf)); + fprintf(stderr, "Processing node: %s\n", node.cn_name); +#endif + + family = ((struct sockaddr *)&(node.cn_address.cna_address))->sa_family; + + if (family == AF_INET6) { + + addr6 = &(((struct sockaddr_in6 *)&(node.cn_address.cna_address))->sin6_addr); + +#ifdef DEBUG + inet_ntop(family, addr6, buf, sizeof(buf)); + fprintf(stderr, " family: ipv6\n address: %s\n", buf); +#endif + + if ((fd = ipv6_connect(addr6, port, timeout)) < 0) { + return -1; + } + + } else { + + addr = &(((struct sockaddr_in *)&(node.cn_address.cna_address))->sin_addr); + +#ifdef DEBUG + inet_ntop(family, addr, buf, sizeof(buf)); + fprintf(stderr, " family: ipv4\n address: %s\n", buf); +#endif + + if ((fd = ipv4_connect(addr, port, timeout)) < 0) { + return -1; + } - if ((fd = ipv4_connect(addr, port, timeout)) < 0) { - return -1; } return fd;