[2/2] batctl: Drop incorrect check for existing meshif directory
Commit Message
The (not silenced) read_file/write_file functions will check whether the
directory of a file exists. This is used to determine whether the mesh
interface was created. In that case, it will print:
Error - mesh has not been enabled yet
Activate your mesh by adding interfaces to batman-adv
This is most of the time wrong because only a limited number of commands
will call these function:
* gw_mode
* log
* loglevel
* routing_algo
* backbonetable
* claimtable
* dat_cache
* gateways
* mcast_flags
* nc_nodes
* neighbors
* originators
* transglobal
* translocal
Beside routing_algo, every command is marked as COMMAND_FLAG_MESH_IFACE and
therefore already requested a check to make sure that the specified meshif
existed at some point.
This message is especially confusing because debugfs can be disabled in
batman-adv. If it was compiled without debugfs and the user tries to still
use `batctl log`, the log command will fail with an incorrect error message
instead of showing a more detailed (and more correct):
Error - can't open file '/sys/kernel/debug//batman_adv/bat0/log': No such file or directory
The option you called seems not to be compiled into your batman-adv kernel module.
Consult the README if you wish to learn more about compiling options into batman-adv.
And for routing_algo, the problem of the missing batman-adv module should
already be catched when the batman-adv module version path is checked.
Reported-by: Andre Kasper <andre.kasper@gmx.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
functions.c | 6 ------
1 file changed, 6 deletions(-)
@@ -149,12 +149,6 @@ static void file_open_problem_dbg(const char *dir, const char *full_path)
return;
}
- if (!file_exists(dir)) {
- fprintf(stderr, "Error - mesh has not been enabled yet\n");
- fprintf(stderr, "Activate your mesh by adding interfaces to batman-adv\n");
- return;
- }
-
fprintf(stderr, "Error - can't open file '%s': %s\n", full_path, strerror(errno));
fprintf(stderr, "The option you called seems not to be compiled into your batman-adv kernel module.\n");
fprintf(stderr, "Consult the README if you wish to learn more about compiling options into batman-adv.\n");