Project

General

Profile

Actions

Bug #326

closed

gw_class changed from 20 to 50 when compiled with BATMAN_V

Added by Sven Eckelmann over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
03/01/2017
Due date:
% Done:

0%

Estimated time:

Description

It looks like the code in 80b2d47be2c7 ("batman-adv: B.A.T.M.A.N. V - implement GW selection logic") unconditionally overwrites the BATMAN_IV gw selection class value with 50 when it was enabled during compile-time.

Problem is that this change of the gw selection class is done in batadv_v_mesh_init:

@@ -397,7 +609,16 @@ void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface)
  */
 int batadv_v_mesh_init(struct batadv_priv *bat_priv)
 {
-    return batadv_v_ogm_init(bat_priv);
+    int ret = 0;
+
+    ret = batadv_v_ogm_init(bat_priv);
+    if (ret < 0)
+        return ret;
+
+    /* set default throughput difference threshold to 5Mbps */
+    atomic_set(&bat_priv->gw.sel_class, 50);
+
+    return 0;
 }

 /**

But batadv_v_mesh_init is called unconditionally in batadv_mesh_init and not only when BATMAN_V is selected as routing algorithm.

The original code (BATMAN_IV) is setting the in gw.sel_class in batadv_softif_init_late. This is a lot earlier than the batadv_mesh_init/batadv_v_mesh_init call.

Actions

Also available in: Atom PDF