sys: byteorder: Fix incorrect shift in sys_get_be48/le48
Fixes an incorrect left-shift value that was introducing extra 0x00 bytes to the result. Signed-off-by: Eric Johnson <eric@liveathos.com>
This commit is contained in:
parent
e01a4df3fb
commit
c27561d984
1 changed files with 2 additions and 2 deletions
|
@ -421,7 +421,7 @@ static inline uint32_t sys_get_be32(const uint8_t src[4])
|
|||
*/
|
||||
static inline uint64_t sys_get_be48(const uint8_t src[6])
|
||||
{
|
||||
return ((uint64_t)sys_get_be32(&src[0]) << 32) | sys_get_be16(&src[4]);
|
||||
return ((uint64_t)sys_get_be32(&src[0]) << 16) | sys_get_be16(&src[4]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -496,7 +496,7 @@ static inline uint32_t sys_get_le32(const uint8_t src[4])
|
|||
*/
|
||||
static inline uint64_t sys_get_le48(const uint8_t src[6])
|
||||
{
|
||||
return ((uint64_t)sys_get_le32(&src[2]) << 32) | sys_get_le16(&src[0]);
|
||||
return ((uint64_t)sys_get_le32(&src[2]) << 16) | sys_get_le16(&src[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue