Commit bc07532c authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov

libceph: fix sa_family just after reading address

It doesn't make sense to leave it undecoded until later.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 428138c9
...@@ -1732,12 +1732,14 @@ static int read_partial_banner(struct ceph_connection *con) ...@@ -1732,12 +1732,14 @@ static int read_partial_banner(struct ceph_connection *con)
ret = read_partial(con, end, size, &con->actual_peer_addr); ret = read_partial(con, end, size, &con->actual_peer_addr);
if (ret <= 0) if (ret <= 0)
goto out; goto out;
ceph_decode_addr(&con->actual_peer_addr);
size = sizeof (con->peer_addr_for_me); size = sizeof (con->peer_addr_for_me);
end += size; end += size;
ret = read_partial(con, end, size, &con->peer_addr_for_me); ret = read_partial(con, end, size, &con->peer_addr_for_me);
if (ret <= 0) if (ret <= 0)
goto out; goto out;
ceph_decode_addr(&con->peer_addr_for_me);
out: out:
return ret; return ret;
...@@ -2010,9 +2012,6 @@ static int process_banner(struct ceph_connection *con) ...@@ -2010,9 +2012,6 @@ static int process_banner(struct ceph_connection *con)
if (verify_hello(con) < 0) if (verify_hello(con) < 0)
return -1; return -1;
ceph_decode_addr(&con->actual_peer_addr);
ceph_decode_addr(&con->peer_addr_for_me);
/* /*
* Make sure the other end is who we wanted. note that the other * Make sure the other end is who we wanted. note that the other
* end may not yet know their ip address, so if it's 0.0.0.0, give * end may not yet know their ip address, so if it's 0.0.0.0, give
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment