Unverified Commit 4a68ff31 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10849 wireguard: allowedips: avoid unaligned 64-bit memory accesses

parents ee146452 6727964b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@ static void swap_endian(u8 *dst, const u8 *src, u8 bits)
	if (bits == 32) {
		*(u32 *)dst = be32_to_cpu(*(const __be32 *)src);
	} else if (bits == 128) {
		((u64 *)dst)[0] = be64_to_cpu(((const __be64 *)src)[0]);
		((u64 *)dst)[1] = be64_to_cpu(((const __be64 *)src)[1]);
		((u64 *)dst)[0] = get_unaligned_be64(src);
		((u64 *)dst)[1] = get_unaligned_be64(src + 8);
	}
}