Skip to contentSkip to conversation

batman-adv: fix logic error in batadv_v_ogm_forward

PATCH Applied Simon Wunderlich 3 participants 3 messages Feb 12, 2016 – Feb 16, 2016 Batman advanced

lore
Share & tools
lore

Simon Wunderlich

author maintainer
#0 lore raw

PATCH 1/1 batman-adv: fix logic error in batadv_v_ogm_forward

From: Simon Wunderlich <[email protected]>

My latest restructure attempt of the BATMAN v forward function introduced a regression, causing kernel crashes when an OGM is forwarded. This patch fixes it.

Fixes 30c96bc787 ("batman-adv: move and restructure

batadv_v_ogm_forward")

---
 net/batman-adv/bat_v_ogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/bat_v_ogm.c +1 -1
index 1b2399e..4155fa5 100644
@@ -309,7 +309,7 @@ static void batadv_v_ogm_forward(struct batadv_priv *bat_priv,
 	u16 tvlv_len;
 
 	/* only forward for specific interfaces, not for the default one. */
-	if (if_outgoing != BATADV_IF_DEFAULT)
+	if (if_outgoing == BATADV_IF_DEFAULT)
 		goto out;
 
 	orig_ifinfo = batadv_orig_ifinfo_new(orig_node, if_outgoing);
Signature · 1 line
2.7.0
Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Friday 12 February 2016 11:35:35 Simon Wunderlich wrote:

From: Simon Wunderlich <[email protected]>

My latest restructure attempt of the BATMAN v forward function introduced a regression, causing kernel crashes when an OGM is forwarded. This patch fixes it.

Fixes 30c96bc787 ("batman-adv: move and restructure

batadv_v_ogm_forward")

Thanks for the fast update. It fixes the problem in my setup

Quoted 18 lines
---
 net/batman-adv/bat_v_ogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/bat_v_ogm.c +1 -1
index 1b2399e..4155fa5 100644
@@ -309,7 +309,7 @@ static void batadv_v_ogm_forward(struct batadv_priv *bat_priv,
 	u16 tvlv_len;
 
 	/* only forward for specific interfaces, not for the default one. */
-	if (if_outgoing != BATADV_IF_DEFAULT)
+	if (if_outgoing == BATADV_IF_DEFAULT)
 		goto out;
 
 	orig_ifinfo = batadv_orig_ifinfo_new(orig_node, if_outgoing);
#2 lore raw
Quoted 7 lines · On Monday, February 15, 2016 09:30:09 Sven Eckelmann wrote:
Quoted 6 lines · On Friday 12 February 2016 11:35:35 Simon Wunderlich wrote:

From: Simon Wunderlich <[email protected]>

My latest restructure attempt of the BATMAN v forward function introduced a regression, causing kernel crashes when an OGM is forwarded. This patch fixes it.

Quoted 8 lines
Quoted 4 lines
Fixes 30c96bc787 ("batman-adv: move and restructure

batadv_v_ogm_forward")

Thanks for the fast update. It fixes the problem in my setup

Applied in revision ef30ba9.

Thanks,
Marek