--- ./keepalived/check/check_data.c.bad 2009-09-24 12:24:25 +0200 +++ ./keepalived/check/check_data.c 2010-04-02 11:19:02 +0200 @@ -250,10 +250,10 @@ new->vsgname = (char *) MALLOC(size + 1); memcpy(new->vsgname, port, size); } else if (!strcmp(ip, "fwmark")) { - new->vfwmark = atoi(port); + new->vfwmark = port ? atoi(port) : 0; } else { inet_ston(ip, &new->addr_ip); - new->addr_port = htons(atoi(port)); + new->addr_port = port ? htons(atoi(port)) : 0; } new->delay_loop = KEEPALIVED_DEFAULT_DELAY; strncpy(new->timeout_persistence, "0", 1); @@ -278,7 +278,7 @@ vs->s_svr = (real_server *) MALLOC(sizeof (real_server)); vs->s_svr->weight = 1; inet_ston(ip, &vs->s_svr->addr_ip); - vs->s_svr->addr_port = htons(atoi(port)); + vs->s_svr->addr_port = port ? htons(atoi(port)) : 0; } /* Real server facility functions */ @@ -324,7 +324,7 @@ new = (real_server *) MALLOC(sizeof (real_server)); inet_ston(ip, &new->addr_ip); - new->addr_port = htons(atoi(port)); + new->addr_port = port ? htons(atoi(port)) : 0; new->weight = 1; new->failed_checkers = alloc_list(free_failed_checkers, NULL);