The annotated tag, batman-adv-for-davem has been deleted
was c7c602bd2b72cfd8fb4c679126aa16113ad51537
-----------------------------------------------------------------------
tag batman-adv-for-davem
Included changes:
- a set of codestyle rearrangements/fixes
- new feature to early detect new joining (mesh-unaware) clients
- a minor fix for the gw-feature
- substitution of shift operations with the BIT() macro
- reorganization of the main batman-adv structure (struct batadv_priv)
- some more (very) minor cleanups and fixes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iEYEABECAAYFAlA2I3gACgkQpGgxIkP9cwcp6QCfc0CcxNdBUJREotieDf5WeO1n
3igAn374RxKRQKfz5w8Vrn2Vz99w5im6
=lWCK
-----END PGP SIGNATURE-----
fa4f0afcf40361bf67ed3abd520a5fbe12d11166 batman-adv: Start new development cycle
-----------------------------------------------------------------------
--
linux integration
The following commit has been merged in the merge/master branch:
commit 74b0a86f3c7e9884f0fcd0d055920ce365885972
Merge: 94c4c96db406fec45fcbba7cdab2aab06a6d6208 da144890cbd04784e6abcf694793d91b6107b074
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Sat Oct 27 16:39:28 2012 +0200
Merge remote-tracking branch 'pkg/master' into merge/master
Conflicts:
net/batman-adv/sysfs-class-net-batman-adv
net/batman-adv/sysfs-class-net-mesh
diff --combined Documentation/ABI/testing/sysfs-class-net-batman-adv
index 38dd762,bdc0070..bdc0070
--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv
+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv
@@@ -1,4 -1,10 +1,10 @@@
+ 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.
+
What: /sys/class/net/<iface>/batman-adv/mesh_iface
Date: May 2010
Contact: Marek Lindner <lindner_marek(a)yahoo.de>
@@@ -7,8 -13,3 +13,3 @@@ Description
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 --combined Documentation/ABI/testing/sysfs-class-net-mesh
index c81fe89,bc41da6..bc41da6
--- a/Documentation/ABI/testing/sysfs-class-net-mesh
+++ b/Documentation/ABI/testing/sysfs-class-net-mesh
@@@ -6,6 -6,14 +6,14 @@@ Description
Indicates whether the batman protocol messages of the
mesh <mesh_iface> shall be aggregated or not.
+ What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
+ Date: May 2011
+ Contact: Antonio Quartulli <ordex(a)autistici.org>
+ Description:
+ Indicates whether the data traffic going from a
+ wireless client to another wireless client will be
+ silently dropped.
+
What: /sys/class/net/<mesh_iface>/mesh/bonding
Date: June 2010
Contact: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
@@@ -31,14 -39,6 +39,6 @@@ Description
mesh will be fragmented or silently discarded if the
packet size exceeds the outgoing interface MTU.
- What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
- Date: May 2011
- Contact: Antonio Quartulli <ordex(a)autistici.org>
- Description:
- Indicates whether the data traffic going from a
- wireless client to another wireless client will be
- silently dropped.
-
What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
Date: October 2010
Contact: Marek Lindner <lindner_marek(a)yahoo.de>
@@@ -60,6 -60,13 +60,13 @@@ Description
Defines the selection criteria this node will use
to choose a gateway if gw_mode was set to 'client'.
+ What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
+ Date: Oct 2010
+ Contact: Linus Lüssing <linus.luessing(a)web.de>
+ Description:
+ Defines the penalty which will be applied to an
+ originator message's tq-field on every hop.
+
What: /sys/class/net/<mesh_iface>/mesh/orig_interval
Date: May 2010
Contact: Marek Lindner <lindner_marek(a)yahoo.de>
@@@ -67,19 -74,12 +74,12 @@@ Description
Defines the interval in milliseconds in which batman
sends its protocol messages.
- What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
- Date: Oct 2010
- Contact: Linus Lüssing <linus.luessing(a)web.de>
- Description:
- Defines the penalty which will be applied to an
- originator message's tq-field on every hop.
-
- What: /sys/class/net/<mesh_iface>/mesh/routing_algo
- Date: Dec 2011
- Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+ What: /sys/class/net/<mesh_iface>/mesh/routing_algo
+ Date: Dec 2011
+ Contact: Marek Lindner <lindner_marek(a)yahoo.de>
Description:
- Defines the routing procotol this mesh instance
- uses to find the optimal paths through the mesh.
+ Defines the routing procotol this mesh instance
+ uses to find the optimal paths through the mesh.
What: /sys/class/net/<mesh_iface>/mesh/vis_mode
Date: May 2010
diff --combined net/batman-adv/bridge_loop_avoidance.c
index a05b1b4,b6da6ae..b6da6ae
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@@ -1249,8 -1249,7 +1249,7 @@@ int batadv_bla_init(struct batadv_priv
/**
* batadv_bla_check_bcast_duplist
* @bat_priv: the bat priv with all the soft interface information
- * @bcast_packet: encapsulated broadcast frame plus batman header
- * @bcast_packet_len: length of encapsulated broadcast frame plus batman header
+ * @skb: contains the bcast_packet to be checked
*
* check if it is on our broadcast list. Another gateway might
* have sent the same packet because it is connected to the same backbone,
@@@ -1262,20 -1261,17 +1261,17 @@@
* the same host however as this might be intended.
*/
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
- struct batadv_bcast_packet *bcast_packet,
- int bcast_packet_len)
+ struct sk_buff *skb)
{
- int i, length, curr, ret = 0;
- uint8_t *content;
- uint16_t crc;
+ int i, curr, ret = 0;
+ __be32 crc;
+ struct batadv_bcast_packet *bcast_packet;
struct batadv_bcast_duplist_entry *entry;
- length = bcast_packet_len - sizeof(*bcast_packet);
- content = (uint8_t *)bcast_packet;
- content += sizeof(*bcast_packet);
+ bcast_packet = (struct batadv_bcast_packet *)skb->data;
/* calculate the crc ... */
- crc = crc16(0, content, length);
+ crc = batadv_skb_crc32(skb, (u8 *)(bcast_packet + 1));
spin_lock_bh(&bat_priv->bla.bcast_duplist_lock);
diff --combined net/batman-adv/bridge_loop_avoidance.h
index 789cb73,196d9a0..196d9a0
--- a/net/batman-adv/bridge_loop_avoidance.h
+++ b/net/batman-adv/bridge_loop_avoidance.h
@@@ -31,8 -31,7 +31,7 @@@ int batadv_bla_backbone_table_seq_print
void *offset);
int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig);
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
- struct batadv_bcast_packet *bcast_packet,
- int hdr_size);
+ struct sk_buff *skb);
void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
struct batadv_hard_iface *primary_if,
struct batadv_hard_iface *oldif);
@@@ -81,8 -80,7 +80,7 @@@ static inline int batadv_bla_is_backbon
static inline int
batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
- struct batadv_bcast_packet *bcast_packet,
- int hdr_size)
+ struct sk_buff *skb)
{
return 0;
}
diff --combined net/batman-adv/routing.c
index 5da62df,5da7724..5da7724
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@@ -1181,16 -1181,12 +1181,12 @@@ int batadv_recv_bcast_packet(struct sk_
spin_unlock_bh(&orig_node->bcast_seqno_lock);
- /* keep skb linear for crc calculation */
- if (skb_linearize(skb) < 0)
+ /* check whether this has been sent by another originator before */
+ if (batadv_bla_check_bcast_duplist(bat_priv, skb))
goto out;
bcast_packet = (struct batadv_bcast_packet *)skb->data;
- /* check whether this has been sent by another originator before */
- if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len))
- goto out;
-
/* rebroadcast packet */
batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
diff --combined net/batman-adv/types.h
index 7b3d0d7,ae9ac9a..ae9ac9a
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@@ -156,7 -156,7 +156,7 @@@ struct batadv_neigh_node
#ifdef CONFIG_BATMAN_ADV_BLA
struct batadv_bcast_duplist_entry {
uint8_t orig[ETH_ALEN];
- uint16_t crc;
+ __be32 crc;
unsigned long entrytime;
};
#endif
--
linux integration
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit da144890cbd04784e6abcf694793d91b6107b074
Author: Simon Wunderlich <simon.wunderlich(a)s2003.tu-chemnitz.de>
Date: Thu Oct 18 13:47:42 2012 +0200
batman-adv: Fix broadcast duplist for fragmentation
If the skb is fragmented, the checksum must be computed on the
individual fragments, just using skb->data may fail on fragmented
data. Instead of doing linearizing the packet, use the new
batadv_crc32 to do that more efficiently- it should not hurt
replacing the old crc16 by the new crc32.
Reported-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
da144890cbd04784e6abcf694793d91b6107b074
bridge_loop_avoidance.c | 18 +++++++-----------
bridge_loop_avoidance.h | 6 ++----
routing.c | 8 ++------
types.h | 2 +-
4 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index a05b1b4..b6da6ae 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -1249,8 +1249,7 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
/**
* batadv_bla_check_bcast_duplist
* @bat_priv: the bat priv with all the soft interface information
- * @bcast_packet: encapsulated broadcast frame plus batman header
- * @bcast_packet_len: length of encapsulated broadcast frame plus batman header
+ * @skb: contains the bcast_packet to be checked
*
* check if it is on our broadcast list. Another gateway might
* have sent the same packet because it is connected to the same backbone,
@@ -1262,20 +1261,17 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
* the same host however as this might be intended.
*/
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
- struct batadv_bcast_packet *bcast_packet,
- int bcast_packet_len)
+ struct sk_buff *skb)
{
- int i, length, curr, ret = 0;
- uint8_t *content;
- uint16_t crc;
+ int i, curr, ret = 0;
+ __be32 crc;
+ struct batadv_bcast_packet *bcast_packet;
struct batadv_bcast_duplist_entry *entry;
- length = bcast_packet_len - sizeof(*bcast_packet);
- content = (uint8_t *)bcast_packet;
- content += sizeof(*bcast_packet);
+ bcast_packet = (struct batadv_bcast_packet *)skb->data;
/* calculate the crc ... */
- crc = crc16(0, content, length);
+ crc = batadv_skb_crc32(skb, (u8 *)(bcast_packet + 1));
spin_lock_bh(&bat_priv->bla.bcast_duplist_lock);
diff --git a/bridge_loop_avoidance.h b/bridge_loop_avoidance.h
index 789cb73..196d9a0 100644
--- a/bridge_loop_avoidance.h
+++ b/bridge_loop_avoidance.h
@@ -31,8 +31,7 @@ int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
void *offset);
int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig);
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
- struct batadv_bcast_packet *bcast_packet,
- int hdr_size);
+ struct sk_buff *skb);
void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
struct batadv_hard_iface *primary_if,
struct batadv_hard_iface *oldif);
@@ -81,8 +80,7 @@ static inline int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv,
static inline int
batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
- struct batadv_bcast_packet *bcast_packet,
- int hdr_size)
+ struct sk_buff *skb)
{
return 0;
}
diff --git a/routing.c b/routing.c
index 5da62df..5da7724 100644
--- a/routing.c
+++ b/routing.c
@@ -1181,16 +1181,12 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
spin_unlock_bh(&orig_node->bcast_seqno_lock);
- /* keep skb linear for crc calculation */
- if (skb_linearize(skb) < 0)
+ /* check whether this has been sent by another originator before */
+ if (batadv_bla_check_bcast_duplist(bat_priv, skb))
goto out;
bcast_packet = (struct batadv_bcast_packet *)skb->data;
- /* check whether this has been sent by another originator before */
- if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len))
- goto out;
-
/* rebroadcast packet */
batadv_add_bcast_packet_to_list(bat_priv, skb, 1);
diff --git a/types.h b/types.h
index 7b3d0d7..ae9ac9a 100644
--- a/types.h
+++ b/types.h
@@ -156,7 +156,7 @@ struct batadv_neigh_node {
#ifdef CONFIG_BATMAN_ADV_BLA
struct batadv_bcast_duplist_entry {
uint8_t orig[ETH_ALEN];
- uint16_t crc;
+ __be32 crc;
unsigned long entrytime;
};
#endif
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit c23260c739356e8662fbe54c26b9afb13e30e445
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Sun Oct 21 17:02:25 2012 +0800
batman-adv: sysfs documentation should keep alphabetical order
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
c23260c739356e8662fbe54c26b9afb13e30e445
sysfs-class-net-batman-adv | 11 ++++++-----
sysfs-class-net-mesh | 40 ++++++++++++++++++++--------------------
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/sysfs-class-net-batman-adv b/sysfs-class-net-batman-adv
index 38dd762..bdc0070 100644
--- a/sysfs-class-net-batman-adv
+++ b/sysfs-class-net-batman-adv
@@ -1,4 +1,10 @@
+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.
+
What: /sys/class/net/<iface>/batman-adv/mesh_iface
Date: May 2010
Contact: Marek Lindner <lindner_marek(a)yahoo.de>
@@ -7,8 +13,3 @@ Description:
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
index c81fe89..bc41da6 100644
--- a/sysfs-class-net-mesh
+++ b/sysfs-class-net-mesh
@@ -6,6 +6,14 @@ Description:
Indicates whether the batman protocol messages of the
mesh <mesh_iface> shall be aggregated or not.
+What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
+Date: May 2011
+Contact: Antonio Quartulli <ordex(a)autistici.org>
+Description:
+ Indicates whether the data traffic going from a
+ wireless client to another wireless client will be
+ silently dropped.
+
What: /sys/class/net/<mesh_iface>/mesh/bonding
Date: June 2010
Contact: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
@@ -31,14 +39,6 @@ Description:
mesh will be fragmented or silently discarded if the
packet size exceeds the outgoing interface MTU.
-What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
-Date: May 2011
-Contact: Antonio Quartulli <ordex(a)autistici.org>
-Description:
- Indicates whether the data traffic going from a
- wireless client to another wireless client will be
- silently dropped.
-
What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
Date: October 2010
Contact: Marek Lindner <lindner_marek(a)yahoo.de>
@@ -60,6 +60,13 @@ Description:
Defines the selection criteria this node will use
to choose a gateway if gw_mode was set to 'client'.
+What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
+Date: Oct 2010
+Contact: Linus Lüssing <linus.luessing(a)web.de>
+Description:
+ Defines the penalty which will be applied to an
+ originator message's tq-field on every hop.
+
What: /sys/class/net/<mesh_iface>/mesh/orig_interval
Date: May 2010
Contact: Marek Lindner <lindner_marek(a)yahoo.de>
@@ -67,19 +74,12 @@ Description:
Defines the interval in milliseconds in which batman
sends its protocol messages.
-What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
-Date: Oct 2010
-Contact: Linus Lüssing <linus.luessing(a)web.de>
-Description:
- Defines the penalty which will be applied to an
- originator message's tq-field on every hop.
-
-What: /sys/class/net/<mesh_iface>/mesh/routing_algo
-Date: Dec 2011
-Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+What: /sys/class/net/<mesh_iface>/mesh/routing_algo
+Date: Dec 2011
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
Description:
- Defines the routing procotol this mesh instance
- uses to find the optimal paths through the mesh.
+ Defines the routing procotol this mesh instance
+ uses to find the optimal paths through the mesh.
What: /sys/class/net/<mesh_iface>/mesh/vis_mode
Date: May 2010
The annotated tag, v3.7-rc2 has been created
at 966b4b0842a6cbbfe8ce8165865b7c4fa993df32 (tag)
tagging 6f0c0580b70c89094b3422ba81118c7b959c7556 (commit)
replaces v3.7-rc1
tagged by Linus Torvalds
on Sat Oct 20 12:11:44 2012 -0700
- Shortlog ------------------------------------------------------------
Linux 3.7-rc2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEcBAABAgAGBQJQgvdwAAoJEHm+PkMAQRiG+3AH/i2XsqqN3VctL0nnbWfvds+Q
aKulfIdJTjKiVAsawPUtRqReZ8ijiebrgA/53lZLlrFOoPPQ5+LHmnSyQF6gErOY
NuAE1lijXDRM1pwBlhvOBbAj26wUobGjqONFJ9OkKr758Ue8ds/Q7UdxyEgmYgmg
tvVMzfRcICzryUV3PcqL+3cNPpCUdT6wGGRJ9DCv/jvGiWKExWhOle5oltrmxk+D
NsqRcws5pEubfHE4J8BvNWr8lE1kHfYVhrJETiLJUiN2XAJcbI4Jy7rU/3EGteNS
0HMZdaPPjV874lohdM70X2225SbYrCVkAYB5hnZCTeC3tYyCawBBPMQoyAiOcmU=
=+861
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The following commit has been merged in the merge/master branch:
commit f32a547626ff950a846197a66eea4860fa907b7b
Author: Linus Lüssing <linus.luessing(a)web.de>
Date: Wed Oct 17 14:53:04 2012 +0200
batman-adv: Fix broadcast packet CRC calculation
So far the crc16 checksum for a batman-adv broadcast data packet, received
on a batman-adv hard interface, was calculated over zero bytes of its
content leading to many incoming broadcast data packets wrongly being
dropped (60-80% packet loss).
This patch fixes this issue by calculating the crc16 over the actual,
complete broadcast payload.
The issue is a regression introduced by
("batman-adv: add broadcast duplicate check").
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Acked-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 0a9084a..eebab20 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1210,8 +1210,8 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
/**
* batadv_bla_check_bcast_duplist
* @bat_priv: the bat priv with all the soft interface information
- * @bcast_packet: originator mac address
- * @hdr_size: maximum length of the frame
+ * @bcast_packet: encapsulated broadcast frame plus batman header
+ * @bcast_packet_len: length of encapsulated broadcast frame plus batman header
*
* check if it is on our broadcast list. Another gateway might
* have sent the same packet because it is connected to the same backbone,
@@ -1224,14 +1224,14 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
*/
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
struct batadv_bcast_packet *bcast_packet,
- int hdr_size)
+ int bcast_packet_len)
{
int i, length, curr;
uint8_t *content;
uint16_t crc;
struct batadv_bcast_duplist_entry *entry;
- length = hdr_size - sizeof(*bcast_packet);
+ length = bcast_packet_len - sizeof(*bcast_packet);
content = (uint8_t *)bcast_packet;
content += sizeof(*bcast_packet);
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 939fc01..376b4cc 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -1124,8 +1124,14 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
spin_unlock_bh(&orig_node->bcast_seqno_lock);
+ /* keep skb linear for crc calculation */
+ if (skb_linearize(skb) < 0)
+ goto out;
+
+ bcast_packet = (struct batadv_bcast_packet *)skb->data;
+
/* check whether this has been sent by another originator before */
- if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, hdr_size))
+ if (batadv_bla_check_bcast_duplist(bat_priv, bcast_packet, skb->len))
goto out;
/* rebroadcast packet */
--
linux integration
The following commit has been merged in the merge/master branch:
commit cbf3c88b7a54dc0e3098a8f7fc8db2333af68eb3
Author: Linus Lüssing <linus.luessing(a)web.de>
Date: Wed Oct 17 14:53:05 2012 +0200
batman-adv: Fix potential broadcast BLA-duplicate-check race condition
Threads in the bottom half of batadv_bla_check_bcast_duplist() might
otherwise for instance overwrite variables which other threads might
be using/reading at the same time in the top half, potentially
leading to messing up the bcast_duplist, possibly resulting in false
bridge loop avoidance duplicate check decisions.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Acked-by: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index eebab20..fd8d5af 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1167,6 +1167,8 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
uint16_t crc;
unsigned long entrytime;
+ spin_lock_init(&bat_priv->bla.bcast_duplist_lock);
+
batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hash registering\n");
/* setting claim destination address */
@@ -1226,7 +1228,7 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
struct batadv_bcast_packet *bcast_packet,
int bcast_packet_len)
{
- int i, length, curr;
+ int i, length, curr, ret = 0;
uint8_t *content;
uint16_t crc;
struct batadv_bcast_duplist_entry *entry;
@@ -1238,6 +1240,8 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
/* calculate the crc ... */
crc = crc16(0, content, length);
+ spin_lock_bh(&bat_priv->bla.bcast_duplist_lock);
+
for (i = 0; i < BATADV_DUPLIST_SIZE; i++) {
curr = (bat_priv->bla.bcast_duplist_curr + i);
curr %= BATADV_DUPLIST_SIZE;
@@ -1259,9 +1263,12 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
/* this entry seems to match: same crc, not too old,
* and from another gw. therefore return 1 to forbid it.
*/
- return 1;
+ ret = 1;
+ goto out;
}
- /* not found, add a new entry (overwrite the oldest entry) */
+ /* not found, add a new entry (overwrite the oldest entry)
+ * and allow it, its the first occurence.
+ */
curr = (bat_priv->bla.bcast_duplist_curr + BATADV_DUPLIST_SIZE - 1);
curr %= BATADV_DUPLIST_SIZE;
entry = &bat_priv->bla.bcast_duplist[curr];
@@ -1270,8 +1277,10 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
memcpy(entry->orig, bcast_packet->orig, ETH_ALEN);
bat_priv->bla.bcast_duplist_curr = curr;
- /* allow it, its the first occurence. */
- return 0;
+out:
+ spin_unlock_bh(&bat_priv->bla.bcast_duplist_lock);
+
+ return ret;
}
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 2ed82ca..ac1e07a 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -205,6 +205,8 @@ struct batadv_priv_bla {
struct batadv_hashtable *backbone_hash;
struct batadv_bcast_duplist_entry bcast_duplist[BATADV_DUPLIST_SIZE];
int bcast_duplist_curr;
+ /* protects bcast_duplist and bcast_duplist_curr */
+ spinlock_t bcast_duplist_lock;
struct batadv_bla_claim_dst claim_dest;
struct delayed_work work;
};
--
linux integration
The annotated tag, batman-adv-fix-for-davem has been updated
to 5f2c2ea5549f748ba9bcc6e7466e61ca98b1bbee (tag)
from 2b1b491ea921e9cd0ff85a15b1ab4fa62b11298e (which is now obsolete)
tagging 7dac7b76b8db87fc79857a53a09730fb2148579b (commit)
replaces v3.7-rc1
tagged by Antonio Quartulli
on Thu Oct 18 18:58:57 2012 +0200
- Shortlog ------------------------------------------------------------
Included fixes:
- Fix broadcast packet CRC calculation which can lead to ~80% broadcast packet
loss
- Fix a race condition in duplicate broadcast packet check
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iEYEABECAAYFAlCANjIACgkQpGgxIkP9cwfeUwCgkGfv2Y8evZYX6d1bW2kFg7di
LJ8AoISKwbTCJUvKrUuQHAvTss7bcX4k
=/dxF
-----END PGP SIGNATURE-----
Linus Lüssing (2):
batman-adv: Fix broadcast packet CRC calculation
batman-adv: Fix potential broadcast BLA-duplicate-check race condition
-----------------------------------------------------------------------
--
linux integration