diff options
| -rw-r--r-- | net/ceph/messenger.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 3661cdd927f1..7e71b0df1fbc 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
| @@ -2058,6 +2058,8 @@ static int process_connect(struct ceph_connection *con) | |||
| 2058 | dout("process_connect on %p tag %d\n", con, (int)con->in_tag); | 2058 | dout("process_connect on %p tag %d\n", con, (int)con->in_tag); |
| 2059 | 2059 | ||
| 2060 | if (con->auth) { | 2060 | if (con->auth) { |
| 2061 | int len = le32_to_cpu(con->in_reply.authorizer_len); | ||
| 2062 | |||
| 2061 | /* | 2063 | /* |
| 2062 | * Any connection that defines ->get_authorizer() | 2064 | * Any connection that defines ->get_authorizer() |
| 2063 | * should also define ->add_authorizer_challenge() and | 2065 | * should also define ->add_authorizer_challenge() and |
| @@ -2067,8 +2069,7 @@ static int process_connect(struct ceph_connection *con) | |||
| 2067 | */ | 2069 | */ |
| 2068 | if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { | 2070 | if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { |
| 2069 | ret = con->ops->add_authorizer_challenge( | 2071 | ret = con->ops->add_authorizer_challenge( |
| 2070 | con, con->auth->authorizer_reply_buf, | 2072 | con, con->auth->authorizer_reply_buf, len); |
| 2071 | le32_to_cpu(con->in_reply.authorizer_len)); | ||
| 2072 | if (ret < 0) | 2073 | if (ret < 0) |
| 2073 | return ret; | 2074 | return ret; |
| 2074 | 2075 | ||
| @@ -2078,10 +2079,12 @@ static int process_connect(struct ceph_connection *con) | |||
| 2078 | return 0; | 2079 | return 0; |
| 2079 | } | 2080 | } |
| 2080 | 2081 | ||
| 2081 | ret = con->ops->verify_authorizer_reply(con); | 2082 | if (len) { |
| 2082 | if (ret < 0) { | 2083 | ret = con->ops->verify_authorizer_reply(con); |
| 2083 | con->error_msg = "bad authorize reply"; | 2084 | if (ret < 0) { |
| 2084 | return ret; | 2085 | con->error_msg = "bad authorize reply"; |
| 2086 | return ret; | ||
| 2087 | } | ||
| 2085 | } | 2088 | } |
| 2086 | } | 2089 | } |
| 2087 | 2090 | ||
