[B.A.T.M.A.N.] [PATCH] batman-adv: Avoid double freeing of bat_counters

2013-04-17 Thread Martin Hundebøll
On errors in batadv_mesh_init(), bat_counters will be freed in both batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this by returning earlier from batadv_softif_init_late() in case of errors in batadv_mesh_init(). Signed-off-by: Martin Hundebøll mar...@hundeboll.net ---

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid double freeing of bat_counters

2013-04-17 Thread Antonio Quartulli
On Wed, Apr 17, 2013 at 12:28:50PM +0200, Martin Hundebøll wrote: On errors in batadv_mesh_init(), bat_counters will be freed in both batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this by returning earlier from batadv_softif_init_late() in case of errors in

[B.A.T.M.A.N.] [PATCHv2] batman-adv: Avoid double freeing of bat_counters

2013-04-17 Thread Martin Hundebøll
On errors in batadv_mesh_init(), bat_counters will be freed in both batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this by returning earlier from batadv_softif_init_late() in case of errors in batadv_mesh_init(). Signed-off-by: Martin Hundebøll mar...@hundeboll.net --- v2:

Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix general protection fault in batadv_tt_global_del_orig()

2013-04-17 Thread Antonio Quartulli
On Sat, Mar 30, 2013 at 02:16:02PM +0100, Antonio Quartulli wrote: On Sun, Mar 17, 2013 at 05:44:58AM +0100, Linus Lüssing wrote: On shutdown a race condition where we access a just freed global TT hash might occure. batadv_orig_node_free_rcu() callbacks might have been scheduled

[B.A.T.M.A.N.] [PATCHv2] batman-adv: move batadv_slide_own_bcast_window to bat_iv_ogm.c

2013-04-17 Thread Antonio Quartulli
From: Antonio Quartulli anto...@open-mesh.com batadv_slide_own_bcast_window() is used only in bat_iv_ogm.c and it is currently touching only batman_iv specific attributes. Move it into bat_iv_ogm.c and make it static. Signed-off-by: Antonio Quartulli anto...@open-mesh.com Signed-off-by: Antonio

Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: Avoid double freeing of bat_counters

2013-04-17 Thread Marek Lindner
On Wednesday, April 17, 2013 20:36:46 Martin Hundebøll wrote: --- a/soft-interface.c +++ b/soft-interface.c @@ -497,12 +497,10 @@ static int batadv_softif_init_late(struct net_device *dev) ret = batadv_mesh_init(dev); if (ret 0) - goto unreg_debugfs; +

Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: move batadv_slide_own_bcast_window to bat_iv_ogm.c

2013-04-17 Thread Marek Lindner
On Wednesday, April 17, 2013 23:44:43 Antonio Quartulli wrote: From: Antonio Quartulli anto...@open-mesh.com batadv_slide_own_bcast_window() is used only in bat_iv_ogm.c and it is currently touching only batman_iv specific attributes. Move it into bat_iv_ogm.c and make it static.

Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: change VID semantic in the BLA code

2013-04-17 Thread Simon Wunderlich
Acked-by: Simon Wunderlich s...@hrz.tu-chemnitz.de Just a small thing which can be adjusted when merging: On Mon, Apr 08, 2013 at 11:17:16AM +0200, Antonio Quartulli wrote: @@ -909,8 +910,9 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,

Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: change VID semantic in the BLA code

2013-04-17 Thread Marek Lindner
On Monday, April 08, 2013 17:17:16 Antonio Quartulli wrote: @@ -307,7 +307,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac, */ memcpy(ethhdr-h_source, mac, ETH_ALEN); batadv_dbg(BATADV_DBG_BLA, bat_priv, -

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use CRC32C instead of CRC16 in TT code

2013-04-17 Thread Marek Lindner
On Wednesday, April 17, 2013 02:16:05 Antonio Quartulli wrote: @@ -1376,13 +1376,11 @@ out: static uint16_t batadv_tt_global_crc(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node) { - uint16_t total = 0, total_one; struct

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use CRC32C instead of CRC16 in TT code

2013-04-17 Thread Antonio Quartulli
On Thu, Apr 18, 2013 at 12:55:40AM +0800, Marek Lindner wrote: On Wednesday, April 17, 2013 02:16:05 Antonio Quartulli wrote: @@ -1376,13 +1376,11 @@ out: static uint16_t batadv_tt_global_crc(struct batadv_priv *bat_priv, struct batadv_orig_node

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: refactor batadv_tt_local_event()

2013-04-17 Thread Marek Lindner
On Wednesday, April 03, 2013 17:15:33 Antonio Quartulli wrote: From: Antonio Quartulli anto...@open-mesh.com Instead of passing a generic combination of flags as argument, it is easier to pass the entire tt_common structure (containing the flags already set) plus a bitfield of additional

Re: [B.A.T.M.A.N.] [PATCHv2 1/2] batman-adv: avoid race conditions on TT global table by counting references

2013-04-17 Thread Linus Lüssing
Hi Antonio, Looks good, I like the idea of using refcounting for the tt global hash. That will indeed nicely remove the ordering dependancy I introduced with my patch earlier. @@ -844,7 +897,17 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv, if (unlikely(hash_added

[B.A.T.M.A.N.] [PATCHv3] batman-adv: Avoid double freeing of bat_counters

2013-04-17 Thread Martin Hundebøll
On errors in batadv_mesh_init(), bat_counters will be freed in both batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this by returning earlier from batadv_softif_init_late() in case of errors in batadv_mesh_init() and by setting bat_counters to NULL after freeing. Signed-off-by:

[B.A.T.M.A.N.] [PATCH next] batman-adv: fix global protection fault during soft_iface destruction

2013-04-17 Thread Antonio Quartulli
batadv_mesh_free() schedules some RCU callbacks which need the bat_priv struct to do their jobs, while free_netdev(), which is called immediately after, is destroying the private data. Put an rcu_barrier() in the middle so that free_netdev() is invoked only after all the callbacks returned. This

Re: [B.A.T.M.A.N.] [PATCHv3] batman-adv: Avoid double freeing of bat_counters

2013-04-17 Thread Marek Lindner
On Thursday, April 18, 2013 03:13:16 Martin Hundebøll wrote: On errors in batadv_mesh_init(), bat_counters will be freed in both batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this by returning earlier from batadv_softif_init_late() in case of errors in batadv_mesh_init()

Re: [B.A.T.M.A.N.] [PATCH next] batman-adv: fix global protection fault during soft_iface destruction

2013-04-17 Thread Marek Lindner
On Thursday, April 18, 2013 03:45:43 Antonio Quartulli wrote: batadv_mesh_free() schedules some RCU callbacks which need the bat_priv struct to do their jobs, while free_netdev(), which is called immediately after, is destroying the private data. Put an rcu_barrier() in the middle so that

[B.A.T.M.A.N.] [PATCH] batman-adv: do not print orig nodes without nc neighbors on nc table print

2013-04-17 Thread Marek Lindner
Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- network-coding.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/network-coding.c b/network-coding.c index c93df9e..b1c733a 100644 --- a/network-coding.c +++ b/network-coding.c @@ -1760,6 +1760,13 @@ int

[B.A.T.M.A.N.] pull request: batman-adv 2013-04-17

2013-04-17 Thread Antonio Quartulli
Hi David, here you have a patch intended for net/linux-3.9 (if it can still make it..). It is fixing a MAC address check routine which does not behave correctly in case of multiple mesh interfaces in the same node. This patch will generate some conflicts the next time you will merge net in

[B.A.T.M.A.N.] [PATCH] batman-adv: make is_my_mac() check for the current mesh only

2013-04-17 Thread Antonio Quartulli
On a multi-mesh node (a node running more than one batman-adv virtual interface) batadv_is_my_mac() has to check MAC addresses of hard interfaces belonging to the current mesh only. Signed-off-by: Antonio Quartulli or...@autistici.org Signed-off-by: Marek Lindner lindner_ma...@yahoo.de ---

[B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Fix broadcast queue limit on a removed interface

2013-04-17 Thread Linus Lüssing
When removing a single interface while a broadcast or ogm packet is still pending then we will free the forward packet without releasing the queue slots again. This patch is supposed to fix this issue. Signed-off-by: Linus Lüssing linus.luess...@web.de --- send.c |6 ++ 1 file changed,

[B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Refactor forward packet creation/destruction

2013-04-17 Thread Linus Lüssing
This patch abstracts the forward packet creation and destruction in the functions batadv_forw_packet_alloc() and batadv_forw_packet_free(). That way there is less complexity to wrap the head around when freeing a forward packet. For instance broadcast/ogm queue left counting will not need to be

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: don't deal with NET_IP_ALIGN manually

2013-04-17 Thread Marek Lindner
On Wednesday, April 03, 2013 04:28:44 Antonio Quartulli wrote: Instead of dealing with NET_IP_ALIGN during allocation and headroom reservation, it is possible to use netdev_alloc_skb_ip_align() which transparently allocate and reserve the correct amount of data Signed-off-by: Antonio

[B.A.T.M.A.N.] [PATCHv2 1/2] batman-adv: Fix broadcast/ogm queue limit on a removed interface

2013-04-17 Thread Linus Lüssing
When removing a single interface while a broadcast or ogm packet is still pending then we will free the forward packet without releasing the queue slots again. This patch is supposed to fix this issue. Signed-off-by: Linus Lüssing linus.luess...@web.de --- send.c |6 ++ 1 file changed,