dhcp6: use unaligned_read_be32()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Sep 2019 13:14:45 +0000 (22:14 +0900)
committerMichael Biebl <biebl@debian.org>
Sun, 10 Nov 2019 23:58:41 +0000 (23:58 +0000)
Closes #13591.

(cherry picked from commit 0eb5e6d3f08c6b3a41cfa7ac02bcc6302259ed4a)
(cherry picked from commit fab6f010ac6c3bc93a10868de722d7c8c3622eb9)

Gbp-Pq: Name dhcp6-use-unaligned_read_be32.patch

src/libsystemd-network/sd-dhcp6-client.c

index 5a3b0a6353bd851694ea7804f32dd4543528933f..9773a067d5858464ce67884861102b35c9f6b94c 100644 (file)
@@ -1005,7 +1005,7 @@ static int client_parse_message(
                         if (optlen != 4)
                                 return -EINVAL;
 
-                        irt = be32toh(*(be32_t *) optval) * USEC_PER_SEC;
+                        irt = unaligned_read_be32((be32_t *) optval) * USEC_PER_SEC;
                         break;
                 }