Commit 8e7c15d6 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli

batman-adv: Remove extra check in batadv_bit_get_packet

batadv_bit_get_packet checks for all common situations before it decides that
the new received packet indicates that the host was restarted. This extra
condition check at the end of the function is not necessary because this
condition is always true.

This patch addresses Coverity #712296: Logically dead code
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
parent 36c1d153
...@@ -79,10 +79,11 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -79,10 +79,11 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
* or the old packet got delayed somewhere in the network. The * or the old packet got delayed somewhere in the network. The
* packet should be dropped without calling this function if the * packet should be dropped without calling this function if the
* seqno window is protected. * seqno window is protected.
*
* seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE
* or
* seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE
*/ */
if (seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE ||
seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE) {
batadv_dbg(BATADV_DBG_BATMAN, bat_priv, batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Other host probably restarted!\n"); "Other host probably restarted!\n");
...@@ -91,8 +92,4 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, ...@@ -91,8 +92,4 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
batadv_set_bit(seq_bits, 0); batadv_set_bit(seq_bits, 0);
return 1; return 1;
}
/* never reached */
return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment