Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201105
b: refs/heads/master
c: 39139f6
h: refs/heads/master
i:
  201103: 8f4982e
v: v3
  • Loading branch information
Sage Weil committed Jul 9, 2010
1 parent 24e4293 commit da2cb05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d06dbaf6c2c7187938f3f6745d9e4938a2d0ec47
refs/heads/master: 39139f64e14684cf2370770deb79d929d27cfd9b
25 changes: 19 additions & 6 deletions trunk/fs/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,19 +997,32 @@ int ceph_parse_ips(const char *c, const char *end,
struct sockaddr_in *in4 = (void *)ss;
struct sockaddr_in6 *in6 = (void *)ss;
int port;
char delim = ',';

if (*p == '[') {
delim = ']';
p++;
}

memset(ss, 0, sizeof(*ss));
if (in4_pton(p, end - p, (u8 *)&in4->sin_addr.s_addr,
',', &ipend)) {
delim, &ipend))
ss->ss_family = AF_INET;
} else if (in6_pton(p, end - p, (u8 *)&in6->sin6_addr.s6_addr,
',', &ipend)) {
else if (in6_pton(p, end - p, (u8 *)&in6->sin6_addr.s6_addr,
delim, &ipend))
ss->ss_family = AF_INET6;
} else {
else
goto bad;
}
p = ipend;

if (delim == ']') {
if (*p != ']') {
dout("missing matching ']'\n");
goto bad;
}
p++;
}

/* port? */
if (p < end && *p == ':') {
port = 0;
Expand Down Expand Up @@ -1043,7 +1056,7 @@ int ceph_parse_ips(const char *c, const char *end,
return 0;

bad:
pr_err("parse_ips bad ip '%s'\n", c);
pr_err("parse_ips bad ip '%.*s'\n", (int)(end - c), c);
return -EINVAL;
}

Expand Down

0 comments on commit da2cb05

Please sign in to comment.