Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ethernet: Copy only 6 bytes of mac address into a u64
[vpp.git]
/
src
/
vnet
/
ethernet
/
mac_address.h
diff --git
a/src/vnet/ethernet/mac_address.h
b/src/vnet/ethernet/mac_address.h
index
68feb39
..
0631ec3
100644
(file)
--- a/
src/vnet/ethernet/mac_address.h
+++ b/
src/vnet/ethernet/mac_address.h
@@
-111,11
+111,11
@@
mac_address_is_zero (const mac_address_t * mac)
static_always_inline u64
mac_address_as_u64 (const mac_address_t * mac)
{
static_always_inline u64
mac_address_as_u64 (const mac_address_t * mac)
{
-
u64 *as_u64
;
+
volatile u64 as_u64 = 0
;
-
as_u64 = (u64 *) mac->bytes
;
+
clib_memcpy ((void *) &as_u64, mac->bytes, 6)
;
- return
(*as_u64)
;
+ return
as_u64
;
}
static_always_inline void
}
static_always_inline void