summaryrefslogtreecommitdiff
path: root/net/batman-adv/packet.h
diff options
context:
space:
mode:
authorSimon Wunderlich <sw@simonwunderlich.de>2013-10-22 22:50:09 +0200
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-23 17:03:47 +0200
commitda6b8c20a5b8c7edce95c95fa2356300691094f5 (patch)
tree1154c27c3f4e9d62c099044f891441125f965e1f /net/batman-adv/packet.h
parent15c33da6e8c960e61691ec302fd72f247e97055b (diff)
downloadlwn-da6b8c20a5b8c7edce95c95fa2356300691094f5.tar.gz
lwn-da6b8c20a5b8c7edce95c95fa2356300691094f5.zip
batman-adv: generalize batman-adv icmp packet handling
Instead of handling icmp packets only up to length of icmp_packet_rr, the code should handle any icmp length size. Therefore the length truncating is moved to when the packet is actually sent to userspace (this does not support lengths longer than icmp_packet_rr yet). Longer packets are forwarded without truncating. This patch also cleans up some parts where the icmp header struct could be used instead of other icmp_packet(_rr) structs to make the code more readable. Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/packet.h')
-rw-r--r--net/batman-adv/packet.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 843b96ac355a..207459b62966 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -239,6 +239,8 @@ struct batadv_icmp_packet_rr {
uint8_t rr[BATADV_RR_LEN][ETH_ALEN];
};
+#define BATADV_ICMP_MAX_PACKET_SIZE sizeof(struct batadv_icmp_packet_rr)
+
/* All packet headers in front of an ethernet header have to be completely
* divisible by 2 but not by 4 to make the payload after the ethernet
* header again 4 bytes boundary aligned.