summaryrefslogtreecommitdiff
path: root/net/batman-adv/bat_algo.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2020-10-11 12:25:24 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2020-12-04 08:40:52 +0100
commita5ad457eea41ef7209f3a1765f853a2c7f191131 (patch)
tree0bca594bc72c4b43bc42ce4704005d343c43672b /net/batman-adv/bat_algo.h
parent128254ceea6ffe59300d3cca6fc83b842048f4c4 (diff)
batman-adv: Allow selection of routing algorithm over rtnetlink
A batadv net_device is associated to a B.A.T.M.A.N. routing algorithm. This algorithm has to be selected before the interface is initialized and cannot be changed after that. The only way to select this algorithm was a module parameter which specifies the default algorithm used during the creation of the net_device. This module parameter is writeable over /sys/module/batman_adv/parameters/routing_algo and thus allows switching of the routing algorithm: 1. change routing_algo parameter 2. create new batadv net_device But this is not race free because another process can be scheduled between 1 + 2 and in that time frame change the routing_algo parameter again. It is much cleaner to directly provide this information inside the rtnetlink's RTM_NEWLINK message. The two processes would be (in regards of the creation parameter of their batadv interfaces) be isolated. This also eases the integration of batadv devices inside tools like network-manager or systemd-networkd which are not expecting to operate on /sys before a new net_device is created. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/bat_algo.h')
-rw-r--r--net/batman-adv/bat_algo.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/batman-adv/bat_algo.h b/net/batman-adv/bat_algo.h
index 686a60bc9492..2ae140eac45d 100644
--- a/net/batman-adv/bat_algo.h
+++ b/net/batman-adv/bat_algo.h
@@ -18,8 +18,9 @@ extern char batadv_routing_algo[];
extern struct list_head batadv_hardif_list;
void batadv_algo_init(void);
+struct batadv_algo_ops *batadv_algo_get(const char *name);
int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops);
-int batadv_algo_select(struct batadv_priv *bat_priv, char *name);
+int batadv_algo_select(struct batadv_priv *bat_priv, const char *name);
int batadv_algo_seq_print_text(struct seq_file *seq, void *offset);
int batadv_algo_dump(struct sk_buff *msg, struct netlink_callback *cb);