diff options
author | Sven Eckelmann <sven@narfation.org> | 2023-08-02 11:39:28 +0300 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2023-08-14 19:01:21 +0300 |
commit | 6f96d46f9a1ad1c02589b598c56ea881094129d8 (patch) | |
tree | 124052fd793a2062206d4c5c520c108ce42fca24 /net/batman-adv/netlink.c | |
parent | 02e61f06a97e7ba73fa44046d6da097e5c2aacc8 (diff) | |
download | linux-6f96d46f9a1ad1c02589b598c56ea881094129d8.tar.xz |
batman-adv: Drop per algo GW section class code
This code was only used in the past for the sysfs interface. But since
this was replace with netlink, it was never executed. The function pointer
was only checked to figure out whether the limit 255 (B.A.T.M.A.N. IV) or
2**32-1 (B.A.T.M.A.N. V) should be used as limit.
So instead of keeping the function pointer, just store the limits directly
in struct batadv_algo_gw_ops.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/netlink.c')
-rw-r--r-- | net/batman-adv/netlink.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index b6c512ce6704..d37872b34281 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -548,15 +548,12 @@ static int batadv_netlink_set_mesh(struct sk_buff *skb, struct genl_info *info) * algorithm in use implements the GW API */ - u32 sel_class_max = 0xffffffffu; + u32 sel_class_max = bat_priv->algo_ops->gw.sel_class_max; u32 sel_class; attr = info->attrs[BATADV_ATTR_GW_SEL_CLASS]; sel_class = nla_get_u32(attr); - if (!bat_priv->algo_ops->gw.store_sel_class) - sel_class_max = BATADV_TQ_MAX_VALUE; - if (sel_class >= 1 && sel_class <= sel_class_max) { atomic_set(&bat_priv->gw.sel_class, sel_class); batadv_gw_reselect(bat_priv); |