Author: simon Date: 2009-10-17 22:01:20 +0000 (Sat, 17 Oct 2009) New Revision: 1451
Modified: trunk/batman-adv-kernelland/routing.c Log: drop false packets which are found in the padding of Ethernet frames.
Modified: trunk/batman-adv-kernelland/routing.c =================================================================== --- trunk/batman-adv-kernelland/routing.c 2009-10-17 19:28:57 UTC (rev 1450) +++ trunk/batman-adv-kernelland/routing.c 2009-10-17 22:01:20 UTC (rev 1451) @@ -400,6 +400,19 @@ char is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0, is_broadcast = 0, is_bidirectional, is_single_hop_neigh, is_duplicate; unsigned short if_incoming_seqno;
+ /* Silently drop when the batman packet is actually not a correct packet. + * + * This might happen if a packet is padded (e.g. Ethernet has a + * minimum frame length of 64 byte) and the aggregation interprets + * it as an additional length. + * + * TODO: A more sane solution would be to have a bit in the batman_packet + * to detect whether the packet is the last packet in an aggregation. + * Here we expect that the padding is always zero (or not 0x01) + */ + if (batman_packet->packet_type != BAT_PACKET) + return; + /* could be changed by schedule_own_packet() */ if_incoming_seqno = atomic_read(&if_incoming->seqno);