public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 01/10] alfred: vis: Fix parsing of iface_status
@ 2016-06-05 18:46 Sven Eckelmann
  2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 02/10] alfred: Split list of objects in Makefile into separate lines Sven Eckelmann
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Sven Eckelmann @ 2016-06-05 18:46 UTC (permalink / raw)
  To: b.a.t.m.a.n

The content of batman_adv/iface_status ends with a newline. Thus
register_interfaces has to make sure that it only compares the first line
without the \n when comparing with the status string.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 vis/vis.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vis/vis.c b/vis/vis.c
index 4d494bc..7eab781 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -257,6 +257,7 @@ static int register_interfaces(struct globals *globals)
 	DIR *iface_base_dir;
 	struct dirent *iface_dir;
 	char *path_buff, *file_content;
+	char *content_newline;
 
 	path_buff = malloc(PATH_BUFF_LEN);
 	if (!path_buff) {
@@ -295,6 +296,10 @@ static int register_interfaces(struct globals *globals)
 		if (!file_content)
 			continue;
 
+		content_newline = strstr(file_content, "\n");
+		if (content_newline)
+			*content_newline = '\0';
+
 		if (strcmp(file_content, "active") == 0)
 			get_if_index(globals, iface_dir->d_name);
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-07-26 11:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05 18:46 [B.A.T.M.A.N.] [PATCH 01/10] alfred: vis: Fix parsing of iface_status Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 02/10] alfred: Split list of objects in Makefile into separate lines Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 03/10] alfred: Add netlink dependencies Sven Eckelmann
2016-07-21 15:58   ` Simon Wunderlich
2016-07-21 16:01     ` Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 04/10] alfred: Add CAP_NET_ADMIN capabilities for netlink Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 05/10] alfred: Split translate_mac from debugfs backend Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 06/10] alfred: Translate mac addresses via netlink Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 07/10] alfred: Split get_tq from debugfs backend Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 08/10] alfred: Query TQ of originators via netlink Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 09/10] alfred: vis: Save device index in interface list Sven Eckelmann
2016-06-05 18:47 ` [B.A.T.M.A.N.] [PATCH 10/10] alfred: vis: Add support for netlink Sven Eckelmann
2016-07-16  7:28 ` [B.A.T.M.A.N.] [PATCH 11/11] alfred: Switch netlink uapi header copyright to ISC Sven Eckelmann
2016-07-26 11:55 ` [B.A.T.M.A.N.] [PATCH 01/10] alfred: vis: Fix parsing of iface_status Simon Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox