Make UDF endian-safe.

Submitted by:	Pedro Martelletto <pedro@ambientworks.net> (via scottl)
Tested on:	sparc64
This commit is contained in:
Will Andrews 2006-02-03 15:25:52 +00:00
parent 556c9a4ca3
commit 937a238777
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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++)

View File

@ -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);