diff options
author | Sage Weil <sage@newdream.net> | 2009-11-03 18:17:56 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-11-03 18:17:56 -0500 |
commit | 63f2d211954b790fea0a9caeae605c7956535af6 (patch) | |
tree | b49257aa54d9657539eeba014f9ff5f91f8495de /fs/ceph/osdmap.c | |
parent | 859e7b149362475672e2a996f29b8f45cbb34d82 (diff) |
ceph: use fixed endian encoding for ceph_entity_addr
We exchange struct ceph_entity_addr over the wire and store it on disk.
The sockaddr_storage.ss_family field, however, is host endianness. So,
fix ss_family endianness to big endian when sending/receiving over the
wire.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/osdmap.c')
-rw-r--r-- | fs/ceph/osdmap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index d62e111b8a34..cd7bb265d789 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c | |||
@@ -460,6 +460,8 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) | |||
460 | 460 | ||
461 | *p += 4; /* skip length field (should match max) */ | 461 | *p += 4; /* skip length field (should match max) */ |
462 | ceph_decode_copy(p, map->osd_addr, map->max_osd*sizeof(*map->osd_addr)); | 462 | ceph_decode_copy(p, map->osd_addr, map->max_osd*sizeof(*map->osd_addr)); |
463 | for (i = 0; i < map->max_osd; i++) | ||
464 | ceph_decode_addr(&map->osd_addr[i]); | ||
463 | 465 | ||
464 | /* pg_temp */ | 466 | /* pg_temp */ |
465 | ceph_decode_32_safe(p, end, len, bad); | 467 | ceph_decode_32_safe(p, end, len, bad); |
@@ -619,6 +621,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
619 | struct ceph_entity_addr addr; | 621 | struct ceph_entity_addr addr; |
620 | ceph_decode_32_safe(p, end, osd, bad); | 622 | ceph_decode_32_safe(p, end, osd, bad); |
621 | ceph_decode_copy_safe(p, end, &addr, sizeof(addr), bad); | 623 | ceph_decode_copy_safe(p, end, &addr, sizeof(addr), bad); |
624 | ceph_decode_addr(&addr); | ||
622 | pr_info("osd%d up\n", osd); | 625 | pr_info("osd%d up\n", osd); |
623 | BUG_ON(osd >= map->max_osd); | 626 | BUG_ON(osd >= map->max_osd); |
624 | map->osd_state[osd] |= CEPH_OSD_UP; | 627 | map->osd_state[osd] |= CEPH_OSD_UP; |