[Olsr-dev] [PATCH] net_olsr.c: add 'interface' to logmessage

Bastian Bittorf (spam-protected)
Sun Feb 28 21:53:16 CET 2016


makes debugging easier if one has a lot of interfaces

Signed-off-by: Bastian Bittorf <(spam-protected)>
---
 src/net_olsr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/net_olsr.c b/src/net_olsr.c
index 37cb970..ab4daa3 100644
--- a/src/net_olsr.c
+++ b/src/net_olsr.c
@@ -384,7 +384,7 @@ net_output(struct interface_olsr *ifp)
         0) {
       perror("sendto(v4)");
 #ifndef _WIN32
-      olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m");
+      olsr_syslog(OLSR_LOG_ERR, "OLSR: interface %d sendto IPv4 %m", ifp->if_index);
 #endif /* _WIN32 */
       retval = -1;
     }
@@ -395,7 +395,7 @@ net_output(struct interface_olsr *ifp)
       struct ipaddr_str buf;
       perror("sendto(v6)");
 #ifndef _WIN32
-      olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
+      olsr_syslog(OLSR_LOG_ERR, "OLSR: interface %d sendto IPv6 %m", ifp->if_index);
 #endif /* _WIN32 */
       fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
       fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
-- 
2.1.4




More information about the Olsr-dev mailing list