Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Marek Lindner, Simon Wunderlich
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include "main.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/moduleparam.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/netlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/printk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/stddef.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <net/genetlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <net/netlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <uapi/linux/batman_adv.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include "bat_algo.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include "netlink.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) char batadv_routing_algo[20] = "BATMAN_IV";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) static struct hlist_head batadv_algo_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * batadv_algo_init() - Initialize batman-adv algorithm management data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  *  structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) void batadv_algo_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	INIT_HLIST_HEAD(&batadv_algo_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static struct batadv_algo_ops *batadv_algo_get(char *name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	struct batadv_algo_ops *bat_algo_ops = NULL, *bat_algo_ops_tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	hlist_for_each_entry(bat_algo_ops_tmp, &batadv_algo_list, list) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 		if (strcmp(bat_algo_ops_tmp->name, name) != 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		bat_algo_ops = bat_algo_ops_tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	return bat_algo_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * batadv_algo_register() - Register callbacks for a mesh algorithm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  * @bat_algo_ops: mesh algorithm callbacks to add
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  * Return: 0 on success or negative error number in case of failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	struct batadv_algo_ops *bat_algo_ops_tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	bat_algo_ops_tmp = batadv_algo_get(bat_algo_ops->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	if (bat_algo_ops_tmp) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		pr_info("Trying to register already registered routing algorithm: %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			bat_algo_ops->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		return -EEXIST;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/* all algorithms must implement all ops (for now) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	if (!bat_algo_ops->iface.enable ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	    !bat_algo_ops->iface.disable ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	    !bat_algo_ops->iface.update_mac ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	    !bat_algo_ops->iface.primary_set ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	    !bat_algo_ops->neigh.cmp ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	    !bat_algo_ops->neigh.is_similar_or_better) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		pr_info("Routing algo '%s' does not implement required ops\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			bat_algo_ops->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	INIT_HLIST_NODE(&bat_algo_ops->list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	hlist_add_head(&bat_algo_ops->list, &batadv_algo_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  * batadv_algo_select() - Select algorithm of soft interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  * @bat_priv: the bat priv with all the soft interface information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  * @name: name of the algorithm to select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  * The algorithm callbacks for the soft interface will be set when the algorithm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  * with the correct name was found. Any previous selected algorithm will not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  * deinitialized and the new selected algorithm will also not be initialized.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  * It is therefore not allowed to call batadv_algo_select outside the creation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * function of the soft interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * Return: 0 on success or negative error number in case of failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) int batadv_algo_select(struct batadv_priv *bat_priv, char *name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	struct batadv_algo_ops *bat_algo_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	bat_algo_ops = batadv_algo_get(name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	if (!bat_algo_ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	bat_priv->algo_ops = bat_algo_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #ifdef CONFIG_BATMAN_ADV_DEBUGFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  * batadv_algo_seq_print_text() - Print the supported algorithms in a seq file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * @seq: seq file to print on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * @offset: not used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  * Return: always 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) int batadv_algo_seq_print_text(struct seq_file *seq, void *offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	struct batadv_algo_ops *bat_algo_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	seq_puts(seq, "Available routing algorithms:\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	hlist_for_each_entry(bat_algo_ops, &batadv_algo_list, list) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		seq_printf(seq, " * %s\n", bat_algo_ops->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static int batadv_param_set_ra(const char *val, const struct kernel_param *kp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	struct batadv_algo_ops *bat_algo_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	char *algo_name = (char *)val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	size_t name_len = strlen(algo_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	if (name_len > 0 && algo_name[name_len - 1] == '\n')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		algo_name[name_len - 1] = '\0';
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	bat_algo_ops = batadv_algo_get(algo_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	if (!bat_algo_ops) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		pr_err("Routing algorithm '%s' is not supported\n", algo_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	return param_set_copystring(algo_name, kp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) static const struct kernel_param_ops batadv_param_ops_ra = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	.set = batadv_param_set_ra,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	.get = param_get_string,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) static struct kparam_string batadv_param_string_ra = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	.maxlen = sizeof(batadv_routing_algo),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	.string = batadv_routing_algo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) module_param_cb(routing_algo, &batadv_param_ops_ra, &batadv_param_string_ra,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		0644);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)  * batadv_algo_dump_entry() - fill in information about one supported routing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)  *  algorithm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)  * @msg: netlink message to be sent back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  * @portid: Port to reply to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)  * @seq: Sequence number of message
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)  * @bat_algo_ops: Algorithm to be dumped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)  * Return: Error number, or 0 on success
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) static int batadv_algo_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 				  struct batadv_algo_ops *bat_algo_ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	void *hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	hdr = genlmsg_put(msg, portid, seq, &batadv_netlink_family,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 			  NLM_F_MULTI, BATADV_CMD_GET_ROUTING_ALGOS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	if (!hdr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		return -EMSGSIZE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	if (nla_put_string(msg, BATADV_ATTR_ALGO_NAME, bat_algo_ops->name))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		goto nla_put_failure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	genlmsg_end(msg, hdr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)  nla_put_failure:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	genlmsg_cancel(msg, hdr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	return -EMSGSIZE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  * batadv_algo_dump() - fill in information about supported routing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)  *  algorithms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  * @msg: netlink message to be sent back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)  * @cb: Parameters to the netlink request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  * Return: Length of reply message.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) int batadv_algo_dump(struct sk_buff *msg, struct netlink_callback *cb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	int portid = NETLINK_CB(cb->skb).portid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	struct batadv_algo_ops *bat_algo_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	int skip = cb->args[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	int i = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	hlist_for_each_entry(bat_algo_ops, &batadv_algo_list, list) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		if (i++ < skip)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		if (batadv_algo_dump_entry(msg, portid, cb->nlh->nlmsg_seq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 					   bat_algo_ops)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 			i--;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	cb->args[0] = i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	return msg->len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) }