netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()
@ 2016-09-20 18:57 Sowmini Varadhan
  2016-09-21  9:43 ` Jiri Benc
  2016-09-21 10:10 ` Hannes Frederic Sowa
  0 siblings, 2 replies; 7+ messages in thread
From: Sowmini Varadhan @ 2016-09-20 18:57 UTC (permalink / raw)
  To: netdev; +Cc: sowmini.varadhan, jbenc, davem, hannes

The vxlan header may not be aligned to 4 bytes in
vxlan_build_skb (e.g., for MLD packets). This patch
avoids unaligned access traps from vxlan_build_skb
(in platforms like sparc) by making struct vxlanhdr __packed.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 include/net/vxlan.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 0255613..1ec56f4 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -18,7 +18,7 @@
 struct vxlanhdr {
 	__be32 vx_flags;
 	__be32 vx_vni;
-};
+} __packed;
 
 /* VXLAN header flags. */
 #define VXLAN_HF_VNI	cpu_to_be32(BIT(27))
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-21 17:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20 18:57 [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb() Sowmini Varadhan
2016-09-21  9:43 ` Jiri Benc
2016-09-21 10:10 ` Hannes Frederic Sowa
2016-09-21 16:14   ` Alexei Starovoitov
2016-09-21 16:49     ` Hannes Frederic Sowa
2016-09-21 16:53     ` Eric Dumazet
2016-09-21 17:12       ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).