batman-adv: generalize batman-adv icmp packet handling
authorSimon Wunderlich <sw@simonwunderlich.de>
Tue, 22 Oct 2013 20:50:09 +0000 (22:50 +0200)
committerAntonio Quartulli <antonio@meshcoding.com>
Wed, 23 Oct 2013 15:03:47 +0000 (17:03 +0200)
commitda6b8c20a5b8c7edce95c95fa2356300691094f5
tree1154c27c3f4e9d62c099044f891441125f965e1f
parent15c33da6e8c960e61691ec302fd72f247e97055b
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>
net/batman-adv/icmp_socket.c
net/batman-adv/icmp_socket.h
net/batman-adv/packet.h
net/batman-adv/routing.c
net/batman-adv/types.h