From 39364e11dd2cf722a037de25705b352272173f21 Mon Sep 17 00:00:00 2001 From: Ales Musil Date: Mon, 25 Jul 2022 16:08:14 +0200 Subject: [PATCH] packets: Fix misaligned access to ip6_hdr. The ip6_hdr is aligned to 4 bytes, but the pointer from dp_packet_l3 is aligned to 2 bytes. Use ovs_16aligned_ip6_hdr instead to get 2 bytes alignment. Signed-off-by: Ales Musil Signed-off-by: Ilya Maximets --- lib/packets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/packets.c b/lib/packets.c index 4d421b811..1dcd4a6fc 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -1709,7 +1709,7 @@ compose_ipv6(struct dp_packet *packet, uint8_t proto, const struct in6_addr *src, const struct in6_addr *dst, uint8_t key_tc, ovs_be32 key_fl, uint8_t key_hl, int size) { - struct ip6_hdr *nh; + struct ovs_16aligned_ip6_hdr *nh; void *data; nh = dp_packet_l3(packet); @@ -1847,7 +1847,7 @@ packet_put_ra_prefix_opt(struct dp_packet *b, const ovs_be128 prefix) { size_t prev_l4_size = dp_packet_l4_size(b); - struct ip6_hdr *nh = dp_packet_l3(b); + struct ovs_16aligned_ip6_hdr *nh = dp_packet_l3(b); nh->ip6_plen = htons(prev_l4_size + ND_PREFIX_OPT_LEN); struct ovs_nd_prefix_opt *prefix_opt =