aboutsummaryrefslogtreecommitdiff
path: root/net/ceph
diff options
context:
space:
mode:
authorJeff Layton2019-06-04 13:13:48 -0400
committerIlya Dryomov2019-07-08 14:01:43 +0200
commitbc07532cc51f4c33cb6136405c9807c5961e468b (patch)
treebaa617bb6b95d929e0eb1e344fb32a4f98649d76 /net/ceph
parent428138c9892fac19a682973bbb6d8c2a904b6639 (diff)
libceph: fix sa_family just after reading address
It doesn't make sense to leave it undecoded until later. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index cd0b094468b6..8d0c51dd4666 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1732,12 +1732,14 @@ static int read_partial_banner(struct ceph_connection *con)
ret = read_partial(con, end, size, &con->actual_peer_addr);
if (ret <= 0)
goto out;
+ ceph_decode_addr(&con->actual_peer_addr);
size = sizeof (con->peer_addr_for_me);
end += size;
ret = read_partial(con, end, size, &con->peer_addr_for_me);
if (ret <= 0)
goto out;
+ ceph_decode_addr(&con->peer_addr_for_me);
out:
return ret;
@@ -2010,9 +2012,6 @@ static int process_banner(struct ceph_connection *con)
if (verify_hello(con) < 0)
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
* end may not yet know their ip address, so if it's 0.0.0.0, give