Skip to content

Commit

Permalink
ctdb_util: use the parse_ip() function - avoid code duplication
Browse files Browse the repository at this point in the history
Michael

Signed-off-by: Michael Adam <[email protected]>

(This used to be ctdb commit 1461b78c47810073f8637bc4592cacaadcdaf14b)
  • Loading branch information
obnoxxx committed Jan 19, 2009
1 parent 8ec92c9 commit b6828ab
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions ctdb/common/ctdb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,7 @@ bool parse_ip_port(const char *addr, ctdb_sock_addr *saddr)


/* now is this a ipv4 or ipv6 address ?*/
p = index(s, ':');
if (p == NULL) {
ret = parse_ipv4(s, port, &saddr->ip);
} else {
ret = parse_ipv6(s, port, saddr);
}
ret = parse_ip(s, addr);

talloc_free(tmp_ctx);
return ret;
Expand Down Expand Up @@ -497,12 +492,7 @@ bool parse_ip_mask(const char *str, ctdb_sock_addr *addr, unsigned *mask)


/* now is this a ipv4 or ipv6 address ?*/
p = index(s, ':');
if (p == NULL) {
ret = parse_ipv4(s, 0, &addr->ip);
} else {
ret = parse_ipv6(s, 0, addr);
}
ret = parse_ip(s, addr);

talloc_free(tmp_ctx);
return ret;
Expand Down

0 comments on commit b6828ab

Please sign in to comment.