mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
ceph: add struct version to auth encoding
Inlucde struct version in encoding. This will streamline future protocol changes. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
9bd2e6f8ba
commit
07c8739c52
@ -107,8 +107,11 @@ int ceph_auth_build_hello(struct ceph_auth_client *ac, void *buf, size_t len)
|
|||||||
lenp = p;
|
lenp = p;
|
||||||
p += sizeof(u32);
|
p += sizeof(u32);
|
||||||
|
|
||||||
|
ceph_decode_need(&p, end, 1 + sizeof(u32), bad);
|
||||||
|
ceph_encode_8(&p, 1);
|
||||||
num = ARRAY_SIZE(supported_protocols);
|
num = ARRAY_SIZE(supported_protocols);
|
||||||
ceph_encode_32(&p, num);
|
ceph_encode_32(&p, num);
|
||||||
|
ceph_decode_need(&p, end, num * sizeof(u32), bad);
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
ceph_encode_32(&p, supported_protocols[i]);
|
ceph_encode_32(&p, supported_protocols[i]);
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ static int ceph_auth_none_create_authorizer(
|
|||||||
if (!ai->built_authorizer) {
|
if (!ai->built_authorizer) {
|
||||||
p = au->buf;
|
p = au->buf;
|
||||||
end = p + sizeof(au->buf);
|
end = p + sizeof(au->buf);
|
||||||
|
ceph_encode_8(&p, 1);
|
||||||
ret = ceph_entity_name_encode(ac->name, &p, end - 8);
|
ret = ceph_entity_name_encode(ac->name, &p, end - 8);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user