Make UDF endian-safe.
Submitted by: Pedro Martelletto <pedro@ambientworks.net> (via scottl) Tested on: sparc64
This commit is contained in:
parent
556c9a4ca3
commit
937a238777
@ -370,4 +370,4 @@ union dscrptr {
|
||||
#define GETICB(ad_type, fentry, offset) \
|
||||
(struct ad_type *)&fentry->data[offset]
|
||||
|
||||
#define GETICBLEN(ad_type, icb) ((struct ad_type *)(icb))->len
|
||||
#define GETICBLEN(ad_type, icb) le32toh(((struct ad_type *)(icb))->len)
|
||||
|
@ -293,7 +293,7 @@ udf_checktag(struct desc_tag *tag, uint16_t id)
|
||||
|
||||
itag = (uint8_t *)tag;
|
||||
|
||||
if (tag->id != id)
|
||||
if (le16toh(tag->id) != id)
|
||||
return (EINVAL);
|
||||
|
||||
for (i = 0; i < 15; i++)
|
||||
|
@ -1090,7 +1090,7 @@ udf_bmap_internal(struct udf_node *node, off_t offset, daddr_t *sector,
|
||||
} while(offset >= icblen);
|
||||
|
||||
lsector = (offset >> udfmp->bshift) +
|
||||
((struct short_ad *)(icb))->pos;
|
||||
le32toh(((struct short_ad *)(icb))->pos);
|
||||
|
||||
*max_size = GETICBLEN(short_ad, icb);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user