aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2012-03-17 03:28:33 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-05-13 13:06:40 -0400
commit8c7bf248a318444accbe0c2c5db15bd727661606 (patch)
tree778d9884d61e32e260e888614fff9aab0019e846 /net
parente3b0d0dea6e044283dff1c0852b20c98eb41a7f1 (diff)
batman-adv: refactor window_protected to avoid unnecessary return statement
Reported-by: David Laight <David.Laight@aculab.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/routing.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index b1824bba09b3..840e2c64a301 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -234,17 +234,14 @@ int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
234{ 234{
235 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) || 235 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
236 (seq_num_diff >= EXPECTED_SEQNO_RANGE)) { 236 (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
237 if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) { 237 if (!has_timed_out(*last_reset, RESET_PROTECTION_MS))
238
239 *last_reset = jiffies;
240 bat_dbg(DBG_BATMAN, bat_priv,
241 "old packet received, start protection\n");
242
243 return 0;
244 } else {
245 return 1; 238 return 1;
246 } 239
240 *last_reset = jiffies;
241 bat_dbg(DBG_BATMAN, bat_priv,
242 "old packet received, start protection\n");
247 } 243 }
244
248 return 0; 245 return 0;
249} 246}
250 247