On Wed, Oct 16, 2013 at 01:59:18PM +0800, Marek Lindner wrote:
On Tuesday 15 October 2013 21:20:23 Antonio Quartulli wrote:
Besides, if we make everything generic batadv_socket_packet->icmp_packet should not be hard-coded to batadv_icmp_packet_rr but the largest available ICMP packet type ?
or we dynamically allocate a buffer of size 'len'? In this way we don't need to change icmp_packet each time (hopefully not so many but still..) the "largest available ICMP packet type" changes.
Allocating a dynamic buffer does not solve the underlying issue. At some point we would want to check the packet size - either through sizeof(socket_packet-
icmp_packet) or a macro or whatever.
Take a look at batadv_max_header_len() for an idea how to address the matter.
Right. Thanks for the clarification
Cheers,