I just sent an improved patch.
Marek Lindner schrieb:
- /* add record route information if not full */
- if (icmp_packet->rr_cur && icmp_packet->rr_cur < BAT_RR_LEN / ETH_ALEN) {
memcpy(&(icmp_packet->rr[icmp_packet->rr_cur * ETH_ALEN]),
ethhdr->h_dest, ETH_ALEN);
icmp_packet->rr_cur++;
- }
It would be better to check for the actual packet size rather than the BAT_RR_LEN define. Some node might have sent us an icmp packet which had a different size and then we crash here (or worse).
This should not be the case because, preliminary to adding RR info, it is checked whether the received frame is long enough for the given packet_type (at least in the current version of the patch).
Regards, Daniel