Hi,
here are patches targeted for 2.6.37. All patches needed for that patchset are already part of your staging-next tree.
All patches are cleanup and bugfix patches and no new feature is added.
thanks, Sven
Linus Lüssing (1): Staging: batman-adv: Fix resizing of broadcast seqno buffers on if deletion
Marek Lindner (4): Staging: batman-adv: document fragmentation sysfs API Staging: batman-adv: protect against ogm packet overflow by checking table length Staging: batman-adv: fix crash when new OGM is generated Staging: batman-adv: process OGMs bigger than MAX_AGGREGATION_BYTES
Sven Eckelmann (2): Staging: batman-adv: Add hash recommendations to TODO Staging: batman-adv: Don't dereference unchecked incoming soft_iface
drivers/staging/batman-adv/TODO | 4 ++++ drivers/staging/batman-adv/aggregation.c | 17 +++++++++++------ drivers/staging/batman-adv/originator.c | 4 ++-- drivers/staging/batman-adv/send.c | 7 +++++-- drivers/staging/batman-adv/sysfs-class-net-mesh | 8 ++++++++ drivers/staging/batman-adv/translation-table.c | 9 +++++++-- 6 files changed, 37 insertions(+), 12 deletions(-)
David Miller davem@davemloft.net recommended in 20100924.134334.28812338.davem@davemloft.net that we must make the hash abstraction helper more efficient and may remove it completely.
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/TODO | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/batman-adv/TODO b/drivers/staging/batman-adv/TODO index 5913731..11c384f 100644 --- a/drivers/staging/batman-adv/TODO +++ b/drivers/staging/batman-adv/TODO @@ -1,3 +1,7 @@ + * remove own list functionality from hash + * use hlist_head, hlist_node in hash + * don't use callbacks for compare+choose in hash + * think about more efficient ways instead of abstraction of hash * Request a new review * Process the comments from the review * Move into mainline proper
send_packet derefenced forw_packet->if_incoming and checked if forw_packet->if_incoming is NULL.
This cannot happen, but still makes irritates when reading through the functions.
Reported-by: Dan Carpenter error27@gmail.com Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/send.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c index 5d57ef5..9032861 100644 --- a/drivers/staging/batman-adv/send.c +++ b/drivers/staging/batman-adv/send.c @@ -160,8 +160,8 @@ static void send_packet_to_if(struct forw_packet *forw_packet, static void send_packet(struct forw_packet *forw_packet) { struct batman_if *batman_if; - struct net_device *soft_iface = forw_packet->if_incoming->soft_iface; - struct bat_priv *bat_priv = netdev_priv(soft_iface); + struct net_device *soft_iface; + struct bat_priv *bat_priv; struct batman_packet *batman_packet = (struct batman_packet *)(forw_packet->skb->data); unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0); @@ -172,6 +172,9 @@ static void send_packet(struct forw_packet *forw_packet) return; }
+ soft_iface = forw_packet->if_incoming->soft_iface; + bat_priv = netdev_priv(soft_iface); + if (forw_packet->if_incoming->if_status != IF_ACTIVE) return;
From: Linus Lüssing linus.luessing@web.de
Not only the entries of the deleted interface got erased, but also all ones with a lower if_num. This commit fixes this issue by setting the destination appropriately.
Signed-off-by: Linus Lüssing linus.luessing@web.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/originator.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/batman-adv/originator.c b/drivers/staging/batman-adv/originator.c index c530df1..865211d 100644 --- a/drivers/staging/batman-adv/originator.c +++ b/drivers/staging/batman-adv/originator.c @@ -456,7 +456,7 @@ static int orig_node_del_if(struct orig_node *orig_node, memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
/* copy second part */ - memcpy(data_ptr, + memcpy(data_ptr + del_if_num * chunk_size, orig_node->bcast_own + ((del_if_num + 1) * chunk_size), (max_if_num - del_if_num) * chunk_size);
@@ -476,7 +476,7 @@ free_bcast_own: memcpy(data_ptr, orig_node->bcast_own_sum, del_if_num * sizeof(uint8_t));
- memcpy(data_ptr, + memcpy(data_ptr + del_if_num * sizeof(uint8_t), orig_node->bcast_own_sum + ((del_if_num + 1) * sizeof(uint8_t)), (max_if_num - del_if_num) * sizeof(uint8_t));
From: Marek Lindner lindner_marek@yahoo.de
Signed-off-by: Marek Lindner lindner_marek@yahoo.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/sysfs-class-net-mesh | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/batman-adv/sysfs-class-net-mesh b/drivers/staging/batman-adv/sysfs-class-net-mesh index 5aa1912..b4cdb60 100644 --- a/drivers/staging/batman-adv/sysfs-class-net-mesh +++ b/drivers/staging/batman-adv/sysfs-class-net-mesh @@ -14,6 +14,14 @@ Description: mesh will be sent using multiple interfaces at the same time (if available).
+What: /sys/class/net/<mesh_iface>/mesh/fragmentation +Date: October 2010 +Contact: Andreas Langer an.langer@gmx.de +Description: + Indicates whether the data traffic going through the + mesh will be fragmented or silently discarded if the + packet size exceeds the outgoing interface MTU. + What: /sys/class/net/<mesh_iface>/mesh/orig_interval Date: May 2010 Contact: Marek Lindner lindner_marek@yahoo.de
From: Marek Lindner lindner_marek@yahoo.de
Reported-by: Sam Yeung sam.cwyeung@gmail.com Signed-off-by: Marek Lindner lindner_marek@yahoo.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/translation-table.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c index 12b2325..681ccbd 100644 --- a/drivers/staging/batman-adv/translation-table.c +++ b/drivers/staging/batman-adv/translation-table.c @@ -59,6 +59,7 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr) struct hna_global_entry *hna_global_entry; struct hashtable_t *swaphash; unsigned long flags; + int required_bytes;
spin_lock_irqsave(&bat_priv->hna_lhash_lock, flags); hna_local_entry = @@ -74,8 +75,12 @@ void hna_local_add(struct net_device *soft_iface, uint8_t *addr) /* only announce as many hosts as possible in the batman-packet and space in batman_packet->num_hna That also should give a limit to MAC-flooding. */ - if ((bat_priv->num_local_hna + 1 > (ETH_DATA_LEN - BAT_PACKET_LEN) - / ETH_ALEN) || + required_bytes = (bat_priv->num_local_hna + 1) * ETH_ALEN; + required_bytes += BAT_PACKET_LEN; + + if ((required_bytes > ETH_DATA_LEN) || + (atomic_read(&bat_priv->aggregation_enabled) && + required_bytes > MAX_AGGREGATION_BYTES) || (bat_priv->num_local_hna + 1 > 255)) { bat_dbg(DBG_ROUTES, bat_priv, "Can't add new local hna entry (%pM): "
From: Marek Lindner lindner_marek@yahoo.de
If aggregation is not enabled the local translation table can grow much bigger and expects to fill a full ethernet packet.
Reported-by: Sam Yeung sam.cwyeung@gmail.com Signed-off-by: Marek Lindner lindner_marek@yahoo.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/aggregation.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/batman-adv/aggregation.c b/drivers/staging/batman-adv/aggregation.c index 46b9c2b..16b268e 100644 --- a/drivers/staging/batman-adv/aggregation.c +++ b/drivers/staging/batman-adv/aggregation.c @@ -123,8 +123,14 @@ static void new_aggregated_packet(unsigned char *packet_buff, int packet_len, return; }
- forw_packet_aggr->skb = dev_alloc_skb(MAX_AGGREGATION_BYTES + - sizeof(struct ethhdr)); + if ((atomic_read(&bat_priv->aggregation_enabled)) && + (packet_len < MAX_AGGREGATION_BYTES)) + forw_packet_aggr->skb = dev_alloc_skb(MAX_AGGREGATION_BYTES + + sizeof(struct ethhdr)); + else + forw_packet_aggr->skb = dev_alloc_skb(packet_len + + sizeof(struct ethhdr)); + if (!forw_packet_aggr->skb) { if (!own_packet) atomic_inc(&bat_priv->batman_queue_left);
From: Marek Lindner lindner_marek@yahoo.de
Reported-by: Sam Yeung sam.cwyeung@gmail.com Signed-off-by: Marek Lindner lindner_marek@yahoo.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- drivers/staging/batman-adv/aggregation.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/batman-adv/aggregation.c b/drivers/staging/batman-adv/aggregation.c index 16b268e..08624d4 100644 --- a/drivers/staging/batman-adv/aggregation.c +++ b/drivers/staging/batman-adv/aggregation.c @@ -257,9 +257,7 @@ void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff,
batman_packet = (struct batman_packet *)packet_buff;
- while (aggregated_packet(buff_pos, packet_len, - batman_packet->num_hna)) { - + do { /* network to host order for our 32bit seqno, and the orig_interval. */ batman_packet->seqno = ntohl(batman_packet->seqno); @@ -272,5 +270,6 @@ void receive_aggr_bat_packet(struct ethhdr *ethhdr, unsigned char *packet_buff, buff_pos += BAT_PACKET_LEN + hna_len(batman_packet); batman_packet = (struct batman_packet *) (packet_buff + buff_pos); - } + } while (aggregated_packet(buff_pos, packet_len, + batman_packet->num_hna)); }
b.a.t.m.a.n@lists.open-mesh.org