From c4c7a8db3384ca5d6f13737d90d75f1f2394dcc9 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 2 Sep 2014 20:15:43 +0200 Subject: [PATCH] saner debug output Signed-off-by: John Crispin --- interface.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/interface.c b/interface.c index 2b09ad3..1584c24 100644 --- a/interface.c +++ b/interface.c @@ -110,6 +110,11 @@ interface_send_packet6(struct interface *iface, struct iovec *iov, int iov_len) int interface_send_packet(struct interface *iface, struct iovec *iov, int iov_len) { + if (debug > 1) { + fprintf(stderr, "TX ipv%d: %s\n", iface->v6 * 2 + 4, iface->name); + fprintf(stderr, " multicast: %d\n", iface->multicast); + } + if (iface->v6) return interface_send_packet6(iface, iov, iov_len); @@ -194,8 +199,7 @@ read_socket4(struct uloop_fd *u, unsigned int events) if (debug > 1) { char buf[256]; - fprintf(stderr, "iface: %s\n", iface->name); - fprintf(stderr, " v6: %d\n", iface->v6); + fprintf(stderr, "RX ipv4: %s\n", iface->name); fprintf(stderr, " multicast: %d\n", iface->multicast); inet_ntop(AF_INET, &from.sin_addr, buf, 256); fprintf(stderr, " src %s:%d\n", buf, from.sin_port); @@ -272,8 +276,7 @@ read_socket6(struct uloop_fd *u, unsigned int events) if (debug > 1) { char buf[256]; - fprintf(stderr, "iface: %s\n", iface->name); - fprintf(stderr, " v6: %d\n", iface->v6); + fprintf(stderr, "RX ipv6: %s\n", iface->name); fprintf(stderr, " multicast: %d\n", iface->multicast); inet_ntop(AF_INET6, &from.sin6_addr, buf, 256); fprintf(stderr, " src %s:%d\n", buf, from.sin6_port); -- 2.25.1