From 89e35df44c641b580c17d6325250b740eeaffb7e Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 1 Mar 2019 21:53:19 +0100 Subject: Wireguard: Debug --- proto/wireguard/wireguard.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'proto') diff --git a/proto/wireguard/wireguard.c b/proto/wireguard/wireguard.c index cdc50317..d959de6f 100644 --- a/proto/wireguard/wireguard.c +++ b/proto/wireguard/wireguard.c @@ -34,6 +34,17 @@ wg_if_notify(struct proto *P, unsigned flags, struct iface *i) } } +static void +dump(void *ptr, size_t len) +{ + unsigned char *data = ptr; + + for (size_t i=0; irtable, n->n.addr); - if (!en) // || en->valid != RIP_ENTRY_VALID) + if (!en) { // || en->valid != RIP_ENTRY_VALID) + debug("WG: fib not found\n"); return; + } struct wg_device *dev = NULL; @@ -201,16 +214,21 @@ wg_rt_notify(struct proto *P, struct channel *ch UNUSED, struct network *n, wg_for_each_allowedip(peer, ip) { if (allowedip->family != ip->family) { + debug("WG: family no match\n"); previp = ip; continue; } if (allowedip->cidr != ip->cidr) { + debug("WG: cidr no match\n"); previp = ip; continue; } if (memcmp(&allowedip->ip6, &ip->ip6, sizeof(struct in6_addr))) { + debug("WG: ip no match\n"); + dump(&allowedip->ip6, sizeof(struct in6_addr)); + dump(&ip->ip6, sizeof(struct in6_addr)); previp = ip; continue; } -- cgit v1.2.3