Re: [PATCH 1/2] batman-adv: Avoid u32 overflow during gateway select

2015-06-22 Thread Antonio Quartulli
On 21/06/15 20:27, Sven Eckelmann wrote: > On Sunday 21 June 2015 09:37:13 David Miller wrote: >> From: Antonio Quartulli >> Date: Tue, 16 Jun 2015 21:06:23 +0200 >> >>> @@ -133,7 +133,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv >>> *bat_priv)> >>> struct batadv_neigh_node *router; >>>

Re: [PATCH 1/2] batman-adv: Avoid u32 overflow during gateway select

2015-06-21 Thread Sven Eckelmann
On Sunday 21 June 2015 09:37:13 David Miller wrote: > From: Antonio Quartulli > Date: Tue, 16 Jun 2015 21:06:23 +0200 > > > @@ -133,7 +133,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv > > *bat_priv)> > > struct batadv_neigh_node *router; > > struct batadv_neigh_ifinfo *router_ifinf

Re: [PATCH 1/2] batman-adv: Avoid u32 overflow during gateway select

2015-06-21 Thread David Miller
From: Antonio Quartulli Date: Tue, 16 Jun 2015 21:06:23 +0200 > @@ -133,7 +133,7 @@ batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv) > struct batadv_neigh_node *router; > struct batadv_neigh_ifinfo *router_ifinfo; > struct batadv_gw_node *gw_node, *curr_gw = NULL; > -

[PATCH 1/2] batman-adv: Avoid u32 overflow during gateway select

2015-06-16 Thread Antonio Quartulli
From: Ruben Wisniewski The gateway selection based on fast connections is using a single value calculated from the average tq (0-255) and the download bandwidth (in 100Kibit). The formula for the first step (tq ** 2 * 1 * bandwidth) tends to overflow a u32 with low bandwidth settings like 50