aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-11 20:07:16 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-15 02:42:36 +0100
commit03257af8c9e08a99650c96144cd3b92653ca4e04 (patch)
tree6e53d19924854f5219a2758defc0e026489ffe04 /src/compat.h
parentsocket: keep track of src address in sending packets (diff)
downloadwireguard-monolithic-historical-03257af8c9e08a99650c96144cd3b92653ca4e04.tar.xz
wireguard-monolithic-historical-03257af8c9e08a99650c96144cd3b92653ca4e04.zip
debug: cleanup skb printing
Diffstat (limited to 'src/compat.h')
-rw-r--r--src/compat.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compat.h b/src/compat.h
index 28c1aca..42fa7fe 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -155,4 +155,14 @@ static inline struct net_device *netdev_pub(void *dev)
return (struct net_device *)((char *)dev - ALIGN(sizeof(struct net_device), NETDEV_ALIGN));
}
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+#define net_dbg_skb_ratelimited(fmt, skb, ...) do { \
+ struct endpoint __endpoint; \
+ socket_endpoint_from_skb(&__endpoint, skb); \
+ net_dbg_ratelimited(fmt, &__endpoint.addr_storage, ##__VA_ARGS__); \
+} while(0)
+#else
+#define net_dbg_skb_ratelimited(fmt, skb, ...)
+#endif
+
#endif