summaryrefslogtreecommitdiff
path: root/usr/src/boot/lib/libstand
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/boot/lib/libstand')
-rw-r--r--usr/src/boot/lib/libstand/zfs/zfsimpl.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/usr/src/boot/lib/libstand/zfs/zfsimpl.c b/usr/src/boot/lib/libstand/zfs/zfsimpl.c
index 9217d4363a..328994ae86 100644
--- a/usr/src/boot/lib/libstand/zfs/zfsimpl.c
+++ b/usr/src/boot/lib/libstand/zfs/zfsimpl.c
@@ -30,6 +30,7 @@
* Stand-alone ZFS file reader.
*/
+#include <sys/endian.h>
#include <sys/stat.h>
#include <sys/stdint.h>
@@ -127,10 +128,7 @@ zfs_free(void *ptr, size_t size)
static int
xdr_int(const unsigned char **xdr, int *ip)
{
- *ip = ((*xdr)[0] << 24)
- | ((*xdr)[1] << 16)
- | ((*xdr)[2] << 8)
- | ((*xdr)[3] << 0);
+ *ip = be32dec(*xdr);
(*xdr) += 4;
return (0);
}
@@ -138,10 +136,7 @@ xdr_int(const unsigned char **xdr, int *ip)
static int
xdr_u_int(const unsigned char **xdr, u_int *ip)
{
- *ip = ((*xdr)[0] << 24)
- | ((*xdr)[1] << 16)
- | ((*xdr)[2] << 8)
- | ((*xdr)[3] << 0);
+ *ip = be32dec(*xdr);
(*xdr) += 4;
return (0);
}