diff --git a/sys/fs/udf/ecma167-udf.h b/sys/fs/udf/ecma167-udf.h index bd78da4b7971..6c7f943f686c 100644 --- a/sys/fs/udf/ecma167-udf.h +++ b/sys/fs/udf/ecma167-udf.h @@ -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) diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 5609d1637321..da3de9861c85 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -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++) diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 0bb91ecc036a..07bd561b6e9f 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -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);