* [B.A.T.M.A.N.] [PATCH] batman-adv: forward late OGMs from best next hop
@ 2013-05-22 18:46 Simon Wunderlich
2013-05-23 9:06 ` Antonio Quartulli
0 siblings, 1 reply; 2+ messages in thread
From: Simon Wunderlich @ 2013-05-22 18:46 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Simon Wunderlich, Antonio Quartulli
From: Simon Wunderlich <simon@open-mesh.com>
When a packet is received from another node first and later from the
best next hop, this packet is dropped. However the first OGM was sent
with the BATADV_NOT_BEST_NEXT_HOP flag and thus dropped by neighbors.
The late OGM from the best neighbor is then dropped because it is a
duplicate.
If this situation happens constantly, a node might end up not forwarding
the "valid" OGMs anymore, and nodes behind will starve from not getting
valid OGMs.
Fix this by changing the is_duplicate behaviour: It will only mark
duplicates which are received for the same neighbor. OGMs which are not
from the best next hop will be dropped within batadv_iv_ogm_forward()
anyway. Therefore, late OGMs are forwarded now and not dropped as
duplicates.
Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
bat_iv_ogm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 8d87f87..bcd2527 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -948,7 +948,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct batadv_orig_node *orig_node;
struct batadv_neigh_node *tmp_neigh_node;
- int is_duplicate = 0;
+ int is_dup = 0;
int32_t seq_diff;
int need_update = 0;
int set_mark, ret = -1;
@@ -972,16 +972,16 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
rcu_read_lock();
hlist_for_each_entry_rcu(tmp_neigh_node,
&orig_node->neigh_list, list) {
- is_duplicate |= batadv_test_bit(tmp_neigh_node->real_bits,
- orig_node->last_real_seqno,
- seqno);
-
neigh_addr = tmp_neigh_node->addr;
if (batadv_compare_eth(neigh_addr, ethhdr->h_source) &&
- tmp_neigh_node->if_incoming == if_incoming)
+ tmp_neigh_node->if_incoming == if_incoming) {
+ is_dup |= batadv_test_bit(tmp_neigh_node->real_bits,
+ orig_node->last_real_seqno,
+ seqno);
set_mark = 1;
- else
+ } else {
set_mark = 0;
+ }
/* if the window moved, set the update flag. */
need_update |= batadv_bit_get_packet(bat_priv,
@@ -1001,7 +1001,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
orig_node->last_real_seqno = seqno;
}
- ret = is_duplicate;
+ ret = is_dup;
out:
spin_unlock_bh(&orig_node->ogm_cnt_lock);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: forward late OGMs from best next hop
2013-05-22 18:46 [B.A.T.M.A.N.] [PATCH] batman-adv: forward late OGMs from best next hop Simon Wunderlich
@ 2013-05-23 9:06 ` Antonio Quartulli
0 siblings, 0 replies; 2+ messages in thread
From: Antonio Quartulli @ 2013-05-23 9:06 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
Cc: Simon Wunderlich
[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]
On Wed, May 22, 2013 at 08:46:17PM +0200, Simon Wunderlich wrote:
> From: Simon Wunderlich <simon@open-mesh.com>
>
> When a packet is received from another node first and later from the
> best next hop, this packet is dropped. However the first OGM was sent
> with the BATADV_NOT_BEST_NEXT_HOP flag and thus dropped by neighbors.
> The late OGM from the best neighbor is then dropped because it is a
> duplicate.
>
> If this situation happens constantly, a node might end up not forwarding
> the "valid" OGMs anymore, and nodes behind will starve from not getting
> valid OGMs.
>
> Fix this by changing the is_duplicate behaviour: It will only mark
> duplicates which are received for the same neighbor. OGMs which are not
> from the best next hop will be dropped within batadv_iv_ogm_forward()
> anyway. Therefore, late OGMs are forwarded now and not dropped as
> duplicates.
>
> Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Thanks for sending this Simon.
However, even if not reported in the subject, this patch is for maint.
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-23 9:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 18:46 [B.A.T.M.A.N.] [PATCH] batman-adv: forward late OGMs from best next hop Simon Wunderlich
2013-05-23 9:06 ` Antonio Quartulli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox