cfab5987891170826b37cbd4795acd6ae1f567b4
[feed/routing.git] / alfred / patches / 0001-alfred-Show-error-message-for-invalid-batadv-interfa.patch
1 From: Sven Eckelmann <sven@narfation.org>
2 Date: Mon, 15 Feb 2021 19:56:22 +0100
3 Subject: alfred: Show error message for invalid batadv interface
4
5 The alfred server process always stopped without any informational message
6 when the provided batman-adv was not "none" and was not accessible. This
7 made it extremely hard to debug the reason why alfred directly stopped
8 after launching it.
9
10 Signed-off-by: Sven Eckelmann <sven@narfation.org>
11 Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-1-sven@narfation.org/
12
13 diff --git a/server.c b/server.c
14 index fc27246b845af75bd1f459f8bb553aef87cc24d5..efac5ad399df52f8c444711a14bcf4814e38a3bf 100644
15 --- a/server.c
16 +++ b/server.c
17 @@ -385,8 +385,11 @@ int alfred_server(struct globals *globals)
18 }
19
20 if (strcmp(globals->mesh_iface, "none") != 0 &&
21 - batadv_interface_check(globals->mesh_iface) < 0)
22 + batadv_interface_check(globals->mesh_iface) < 0) {
23 + fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
24 + globals->mesh_iface);
25 return -1;
26 + }
27
28 num_socks = netsock_open_all(globals);
29 if (num_socks <= 0) {