From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Force packed placment of tt_change
Date: Sun, 12 Jun 2011 11:10:38 +0200 [thread overview]
Message-ID: <1307869838-25550-1-git-send-email-sven@narfation.org> (raw)
Every data structure which is used to send data over the wire must be
fixed in layout to prevent incompatibility between different
architectures. Those incompatibilities could be generated by extra bytes
between members and at the end of the structure.
tt_changes_fill_buffer and tt_len use that structure to copy the correct
amount of data from an internal structure to the actual packet. We must
ensure that this packet buffer only has data which can be interpreted by
any architecture.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
packet.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/packet.h b/packet.h
index 0c3e44d..ef7476f 100644
--- a/packet.h
+++ b/packet.h
@@ -202,6 +202,6 @@ struct roam_adv_packet {
struct tt_change {
uint8_t flags;
uint8_t addr[ETH_ALEN];
-};
+} __packed;
#endif /* _NET_BATMAN_ADV_PACKET_H_ */
--
1.7.5.4
next reply other threads:[~2011-06-12 9:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-12 9:10 Sven Eckelmann [this message]
2011-06-12 10:04 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Force packed placment of tt_change Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1307869838-25550-1-git-send-email-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox