![Simon Wunderlich](/assets/img/avatar_default.png)
This patch limits the queue lengths of batman and broadcast packets. BATMAN packets are held back for aggregation and jittered to avoid interferences. Broadcast packets are stored to be sent out multiple times to increase the probability to be received by other nodes in lossy environments. Especially in extreme cases like broadcast storms, the queues have been seen to run full, eating up all the memory and triggering the infamous OOM killer. With the queue length limits introduced in this patch, this problem is avoided. Each queue is limited to 256 entries for now, resulting in 1 MB of maximum space available in total for typical setups (assuming one packet including overhead does not require more than 2000 byte). This should also be reasonable for smaller routers, otherwise the defines can be tweaked later. This third version of the patch does not increase the local broadcast sequence number when the queue is already full. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
40 lines
1.5 KiB
C
40 lines
1.5 KiB
C
/*
|
|
* Copyright (C) 2007-2010 B.A.T.M.A.N. contributors:
|
|
*
|
|
* Marek Lindner, Simon Wunderlich
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of version 2 of the GNU General Public
|
|
* License as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
* 02110-1301, USA
|
|
*
|
|
*/
|
|
|
|
#include "types.h"
|
|
|
|
void send_own_packet_work(struct work_struct *work);
|
|
int send_skb_packet(struct sk_buff *skb,
|
|
struct batman_if *batman_if,
|
|
uint8_t *dst_addr);
|
|
void send_raw_packet(unsigned char *pack_buff, int pack_buff_len,
|
|
struct batman_if *batman_if, uint8_t *dst_addr);
|
|
void schedule_own_packet(struct batman_if *batman_if);
|
|
void schedule_forward_packet(struct orig_node *orig_node,
|
|
struct ethhdr *ethhdr,
|
|
struct batman_packet *batman_packet,
|
|
uint8_t directlink, int hna_buff_len,
|
|
struct batman_if *if_outgoing);
|
|
int add_bcast_packet_to_list(struct sk_buff *skb);
|
|
void send_outstanding_bcast_packet(struct work_struct *work);
|
|
void send_outstanding_bat_packet(struct work_struct *work);
|
|
void purge_outstanding_packets(struct batman_if *batman_if);
|