summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-12-03 19:52:47 +0100
committerThomas Haller <thaller@redhat.com>2022-12-09 12:47:51 +0100
commit677be52f7109c248a2ea35393871fd6c2f67560a (patch)
tree237ebb55f61975ab7eb071d81239a6e719b36519
parented47047a36349a21a6d0d47ba38b385ac27d8b8d (diff)
core: fix possible unaligned access in nm_utils_get_ipv6_interface_identifier()
Fixes: e2270040c0a2 ('core: use Interface Identifiers for IPv6 SLAAC addresses') (cherry picked from commit 0f4114c27c82ce9bfb2e38ff6f7269f6376cb9f8)
-rw-r--r--src/core/nm-core-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c
index 480e9b28f0..25b2f3b909 100644
--- a/src/core/nm-core-utils.c
+++ b/src/core/nm-core-utils.c
@@ -3272,7 +3272,7 @@ nm_utils_get_ipv6_interface_identifier(NMLinkType link_type,
case NM_LINK_TYPE_GRE:
/* Hardware address is the network-endian IPv4 address */
g_return_val_if_fail(hwaddr_len == 4, FALSE);
- addr = *(guint32 *) hwaddr;
+ addr = unaligned_read_ne32(hwaddr);
out_iid->id_u8[0] = get_gre_eui64_u_bit(addr);
out_iid->id_u8[1] = 0x00;
out_iid->id_u8[2] = 0x5E;