The following commit has been merged in the next branch:
commit a2a59e3be6559abbd17a63ae81185c338cd8d560
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon Oct 18 09:12:28 2010 +0000
batman-adv: protect against ogm packet overflow by checking table length
Reported-by: Sam Yeung <sam.cwyeung(a)gmail.com>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/translation-table.c b/translation-table.c
index 9cae140..75c8ce0 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -60,6 +60,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 =
@@ -75,8 +76,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): "
--
batman-adv
The following commit has been merged in the master branch:
commit f1bc6003efcdd7cab0c3a2673761435bd4b55755
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon Oct 18 09:12:28 2010 +0000
batman-adv: protect against ogm packet overflow by checking table length
Reported-by: Sam Yeung <sam.cwyeung(a)gmail.com>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/translation-table.c b/translation-table.c
index 9cae140..75c8ce0 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -60,6 +60,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 =
@@ -75,8 +76,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): "
--
batman-adv
The following commit has been merged in the master branch:
commit 9f0c9aeb4de695c92a9fb7bb18bcce379b8f0bf3
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon Oct 18 09:12:29 2010 +0000
batman-adv: fix crash when new OGM is generated
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(a)gmail.com>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/aggregation.c b/aggregation.c
index 46b9c2b..16b268e 100644
--- a/aggregation.c
+++ b/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);
--
batman-adv
The following commit has been merged in the master branch:
commit 96808314917e371370dfed4f9fde7ccbfe82ee44
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon Oct 18 09:09:57 2010 +0000
batman-adv: document fragmentation sysfs API
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/sysfs-class-net-mesh b/sysfs-class-net-mesh
index 5aa1912..b4cdb60 100644
--- a/sysfs-class-net-mesh
+++ b/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(a)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(a)yahoo.de>
--
batman-adv
The following commit has been merged in the next branch:
commit ea9f180ddebba44849cd9785a9c998dec6b22766
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Fri Oct 15 15:47:52 2010 +0000
batman-adv: Add batman-adv sysfs ABI documentation
The kernel requires to have all files in /sys documented and updated
when new files are added.
batman-adv has two important classes of files: one class for each mesh
device and one for a directory in all normal netdevice folders.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/sysfs-class-net-batman-adv b/sysfs-class-net-batman-adv
new file mode 100644
index 0000000..38dd762
--- /dev/null
+++ b/sysfs-class-net-batman-adv
@@ -0,0 +1,14 @@
+
+What: /sys/class/net/<iface>/batman-adv/mesh_iface
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ The /sys/class/net/<iface>/batman-adv/mesh_iface file
+ displays the batman mesh interface this <iface>
+ currently is associated with.
+
+What: /sys/class/net/<iface>/batman-adv/iface_status
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Indicates the status of <iface> as it is seen by batman.
diff --git a/sysfs-class-net-mesh b/sysfs-class-net-mesh
new file mode 100644
index 0000000..5aa1912
--- /dev/null
+++ b/sysfs-class-net-mesh
@@ -0,0 +1,33 @@
+
+What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Indicates whether the batman protocol messages of the
+ mesh <mesh_iface> shall be aggregated or not.
+
+What: /sys/class/net/<mesh_iface>/mesh/bonding
+Date: June 2010
+Contact: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
+Description:
+ Indicates whether the data traffic going through the
+ mesh will be sent using multiple interfaces at the
+ same time (if available).
+
+What: /sys/class/net/<mesh_iface>/mesh/orig_interval
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Defines the interval in milliseconds in which batman
+ sends its protocol messages.
+
+What: /sys/class/net/<mesh_iface>/mesh/vis_mode
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Each batman node only maintains information about its
+ own local neighborhood, therefore generating graphs
+ showing the topology of the entire mesh is not easily
+ feasible without having a central instance to collect
+ the local topologies from all nodes. This file allows
+ to activate the collecting (server) mode.
--
batman-adv