b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batctl: Fix error message when tcpdump packet sent failed
@ 2017-07-05 15:15 Sven Eckelmann
  0 siblings, 0 replies; only message in thread
From: Sven Eckelmann @ 2017-07-05 15:15 UTC (permalink / raw)
  To: b.a.t.m.a.n

The strerror converts the positive error code into a string. tcpdump must
therefore convert the negative return code from icmp_interface_write into a
positive one before using it as parameter for strerror.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 traceroute.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traceroute.c b/traceroute.c
index 124ce7c..79d3800 100644
--- a/traceroute.c
+++ b/traceroute.c
@@ -150,7 +150,7 @@ int traceroute(char *mesh_iface, int argc, char **argv)
 					   (struct batadv_icmp_header *)&icmp_packet_out,
 					   sizeof(icmp_packet_out));
 			if (res < 0) {
-				fprintf(stderr, "Error - can't send icmp packet: %s\n", strerror(res));
+				fprintf(stderr, "Error - can't send icmp packet: %s\n", strerror(-res));
 				continue;
 			}
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-05 15:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 15:15 [B.A.T.M.A.N.] [PATCH] batctl: Fix error message when tcpdump packet sent failed Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).