On Tuesday 22 October 2013 22:50:09 Simon Wunderlich wrote:
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
Changes to PATCHv2 (as per IRC discussion with Marek and Antonio):
- use length for icmp_len after truncating in batadv_socket_add_packet
- remove the MAX macro and define packet size to icmp_packet_rr for now
Changes to PATCHv1 (suggested by Marek):
- use maximum packet size for batadv_socket_client icmp_packet instead of hardcoded icmp_packet_rr
- drop unknown packet types in batadv_recv_my_icmp_packet()
- remove usage for icmp_packet_rr in batadv_socket_write where not needed, and check for message type
- use right length parameter in batadv_socket_add_packet
icmp_socket.c | 128 ++++++++++++++++++++++++++++++++++--------------------- icmp_socket.h | 2 +- packet.h | 2 + routing.c | 131 ++++++++++++++++++++++++++++++++++----------------------- types.h | 2 +- 5 files changed, 163 insertions(+), 102 deletions(-)
Applied in revision bb69cb6.
Thanks, Marek