Antonio Quartulli | 14 Jun 2012 23:27
Gravatar

[PATCH] batman-adv: don't redirect tt_request for me

If a tt_request is directed to me, it never has to be redirected

Signed-off-by: Antonio Quartulli <ordex@...>
---
 translation-table.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 2a6d7d6..c32c5f6 100644
--- a/translation-table.c
+++ b/translation-table.c
 <at>  <at>  -1648,7 +1648,7  <at>  <at>  out:

 }

-static bool
+static void
 batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 			   struct batadv_tt_query_packet *tt_request)
 {
 <at>  <at>  -1656,7 +1656,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 	struct batadv_neigh_node *neigh_node = NULL;
 	struct batadv_hard_iface *primary_if = NULL;
 	uint8_t my_ttvn, req_ttvn, ttvn;
-	int ret = false;
 	unsigned char *tt_buff;
 	bool full_table;
 	uint16_t tt_len, tt_tot;
 <at>  <at>  -1751,7 +1750,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 	batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
(Continue reading)

Antonio Quartulli | 14 Jun 2012 23:36
Gravatar

Re: [PATCH] batman-adv: don't redirect tt_request for me

On Thu, Jun 14, 2012 at 11:27:27PM +0200, Antonio Quartulli wrote:
> If a tt_request is directed to me, it never has to be redirected
> 
> Signed-off-by: Antonio Quartulli <ordex@...>

sorry, drop this patch. I'll send v2

Cheers,

--

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
Antonio Quartulli | 14 Jun 2012 23:38
Gravatar

[PATCHv2] batman-adv: don't reroute tt_request for me

If a tt_request is directed to me, it never has to be rerouted

Signed-off-by: Antonio Quartulli <ordex@...>
---
 translation-table.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 2a6d7d6..9eb45c8 100644
--- a/translation-table.c
+++ b/translation-table.c
 <at>  <at>  -1648,7 +1648,7  <at>  <at>  out:

 }

-static bool
+static void
 batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 			   struct batadv_tt_query_packet *tt_request)
 {
 <at>  <at>  -1656,7 +1656,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 	struct batadv_neigh_node *neigh_node = NULL;
 	struct batadv_hard_iface *primary_if = NULL;
 	uint8_t my_ttvn, req_ttvn, ttvn;
-	int ret = false;
 	unsigned char *tt_buff;
 	bool full_table;
 	uint16_t tt_len, tt_tot;
 <at>  <at>  -1751,7 +1750,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 	batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
(Continue reading)

Marek Lindner | 15 Jun 2012 21:50
Picon
Favicon

Re: [PATCHv2] batman-adv: don't reroute tt_request for me

On Friday, June 15, 2012 05:38:37 Antonio Quartulli wrote:
> If a tt_request is directed to me, it never has to be rerouted

We will need a little more explanation here about what is going on and what is 
fixed and why we want it to be fixed.

Cheers,
Marek

Antonio Quartulli | 15 Jun 2012 22:20
Gravatar

Re: [PATCHv2] batman-adv: don't reroute tt_request for me

On Sat, Jun 16, 2012 at 03:50:00AM +0800, Marek Lindner wrote:
> On Friday, June 15, 2012 05:38:37 Antonio Quartulli wrote:
> > If a tt_request is directed to me, it never has to be rerouted
> 
> We will need a little more explanation here about what is going on and what is 
> fixed and why we want it to be fixed.

Sure,
I'll send v2 with a improved message

> 
> Cheers,
> Marek

--

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
Antonio Quartulli | 15 Jun 2012 22:21
Gravatar

Re: [PATCHv2] batman-adv: don't reroute tt_request for me

On Fri, Jun 15, 2012 at 10:20:35PM +0200, Antonio Quartulli wrote:
> On Sat, Jun 16, 2012 at 03:50:00AM +0800, Marek Lindner wrote:
> > On Friday, June 15, 2012 05:38:37 Antonio Quartulli wrote:
> > > If a tt_request is directed to me, it never has to be rerouted
> > 
> > We will need a little more explanation here about what is going on and what is 
> > fixed and why we want it to be fixed.
> 
> Sure,
> I'll send v2 with a improved message
> 

I clearly meant v3, sorry

> > 
> > Cheers,
> > Marek
> 
> -- 
> Antonio Quartulli
> 
> ..each of us alone is worth nothing..
> Ernesto "Che" Guevara

--

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
(Continue reading)

Antonio Quartulli | 16 Jun 2012 08:27
Gravatar

[PATCHv3] batman-adv: don't try to re-route tt_request for me

If a TT_Request is directed to a node and it fails in handling it (e.g. it
does not know the source node yet), the node will print a "re-routing" message
and will try to forward the packet. However it will fails because the
destination is itself. To avoid this misbehaviour, the node has to never try to
re-route a packet directed to it.

Signed-off-by: Antonio Quartulli <ordex@...>
---
 translation-table.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/translation-table.c b/translation-table.c
index 2a6d7d6..9eb45c8 100644
--- a/translation-table.c
+++ b/translation-table.c
 <at>  <at>  -1648,7 +1648,7  <at>  <at>  out:

 }

-static bool
+static void
 batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 			   struct batadv_tt_query_packet *tt_request)
 {
 <at>  <at>  -1656,7 +1656,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
 	struct batadv_neigh_node *neigh_node = NULL;
 	struct batadv_hard_iface *primary_if = NULL;
 	uint8_t my_ttvn, req_ttvn, ttvn;
-	int ret = false;
 	unsigned char *tt_buff;
(Continue reading)

Marek Lindner | 16 Jun 2012 21:00
Picon
Favicon

Re: [PATCHv3] batman-adv: don't try to re-route tt_request for me

On Saturday, June 16, 2012 14:27:41 Antonio Quartulli wrote:
> -static bool
> +static void
>  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
>                            struct batadv_tt_query_packet *tt_request)
>  {
>  <at>  <at>  -1656,7 +1656,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv
> *bat_priv, struct batadv_neigh_node *neigh_node = NULL;
>         struct batadv_hard_iface *primary_if = NULL;
>         uint8_t my_ttvn, req_ttvn, ttvn;
> -       int ret = false;
>         unsigned char *tt_buff;
>         bool full_table;
>         uint16_t tt_len, tt_tot;
>  <at>  <at>  -1751,7 +1750,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv
> *bat_priv, batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
>  
>         batadv_send_skb_packet(skb, neigh_node->if_incoming,
> neigh_node->addr); -       ret = true;
>         goto out;
>  
>  unlock:
>  <at>  <at>  -1763,10 +1761,6  <at>  <at>  out:
>                 batadv_neigh_node_free_ref(neigh_node);
>         if (primary_if)
>                 batadv_hardif_free_ref(primary_if);
> -       if (!ret)
> -               kfree_skb(skb);
> -       /* This packet was for me, so it doesn't need to be re-routed */
> -       return true;
(Continue reading)

Antonio Quartulli | 17 Jun 2012 00:11
Gravatar

Re: [PATCHv3] batman-adv: don't try to re-route tt_request for me

On Sun, Jun 17, 2012 at 03:00:14AM +0800, Marek Lindner wrote:
> On Saturday, June 16, 2012 14:27:41 Antonio Quartulli wrote:
> > -static bool
> > +static void
> >  batadv_send_my_tt_response(struct batadv_priv *bat_priv,
> >                            struct batadv_tt_query_packet *tt_request)
> >  {
> >  <at>  <at>  -1656,7 +1656,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv
> > *bat_priv, struct batadv_neigh_node *neigh_node = NULL;
> >         struct batadv_hard_iface *primary_if = NULL;
> >         uint8_t my_ttvn, req_ttvn, ttvn;
> > -       int ret = false;
> >         unsigned char *tt_buff;
> >         bool full_table;
> >         uint16_t tt_len, tt_tot;
> >  <at>  <at>  -1751,7 +1750,6  <at>  <at>  batadv_send_my_tt_response(struct batadv_priv
> > *bat_priv, batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_TX);
> >  
> >         batadv_send_skb_packet(skb, neigh_node->if_incoming,
> > neigh_node->addr); -       ret = true;
> >         goto out;
> >  
> >  unlock:
> >  <at>  <at>  -1763,10 +1761,6  <at>  <at>  out:
> >                 batadv_neigh_node_free_ref(neigh_node);
> >         if (primary_if)
> >                 batadv_hardif_free_ref(primary_if);
> > -       if (!ret)
> > -               kfree_skb(skb);
> > -       /* This packet was for me, so it doesn't need to be re-routed */
(Continue reading)

Antonio Quartulli | 17 Jun 2012 20:05
Gravatar

Re: [PATCHv3] batman-adv: don't try to re-route tt_request for me

On Sun, Jun 17, 2012 at 12:11:18AM +0200, Antonio Quartulli wrote:
> On Sun, Jun 17, 2012 at 03:00:14AM +0800, Marek Lindner wrote:
> > On Saturday, June 16, 2012 14:27:41 Antonio Quartulli wrote:
> You are right. I misinterpreted this skb.
> I'll send v4 soon!
> 
> Thank you
> 

After having read this patch more and more I can conclude that we do not really
need it. send_my_tt_response() will always return true and so the problem I
mentioned cannot be triggered at all.
I don't know if we really need a bool function if it does always return true.
But this is a different issue.

Cheers,

--

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

Gmane