diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-06 18:39:28 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-06 18:39:28 +0100 |
commit | 468424d08834cac9a5b494dc88048da1af110af3 (patch) | |
tree | 1756182a7f1cb1bf349137e9fa1f3ec975d60241 | |
parent | f7483321a25f8ce8e919ff635798db75976a11e5 (diff) |
debug: support dynamic debug on skb addr
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/device.c | 2 | ||||
-rw-r--r-- | src/receive.c | 8 | ||||
-rw-r--r-- | src/send.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/device.c b/src/device.c index 41df285..46d6704 100644 --- a/src/device.c +++ b/src/device.c @@ -111,7 +111,7 @@ static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev) peer = routing_table_lookup_dst(&wg->peer_routing_table, skb); if (unlikely(!peer)) { -#ifdef DEBUG +#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) struct sockaddr_storage addr; socket_addr_from_skb(&addr, skb); net_dbg_ratelimited("No peer is configured for %pISc\n", &addr); diff --git a/src/receive.c b/src/receive.c index 307baff..8a9ff3d 100644 --- a/src/receive.c +++ b/src/receive.c @@ -33,7 +33,7 @@ static inline void update_latest_addr(struct wireguard_peer *peer, struct sk_buf static inline int skb_data_offset(struct sk_buff *skb, size_t *data_offset, size_t *data_len) { struct udphdr *udp; -#ifdef DEBUG +#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) struct sockaddr_storage addr = { 0 }; socket_addr_from_skb(&addr, skb); #else @@ -84,7 +84,7 @@ static void receive_handshake_packet(struct wireguard_device *wg, void *data, si enum cookie_mac_state mac_state; bool packet_needs_cookie; -#ifdef DEBUG +#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) struct sockaddr_storage addr = { 0 }; socket_addr_from_skb(&addr, skb); #else @@ -277,7 +277,7 @@ static void receive_data_packet(struct sk_buff *skb, struct wireguard_peer *peer peer_put(routed_peer); /* We don't need the extra reference. */ if (unlikely(routed_peer != peer)) { -#ifdef DEBUG +#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) struct sockaddr_storage unencrypted_addr = { 0 }; socket_addr_from_skb(&unencrypted_addr, skb); net_dbg_ratelimited("Packet has unallowed src IP (%pISc) from peer %Lu (%pISpfsc)\n", &unencrypted_addr, peer->internal_id, addr); @@ -308,7 +308,7 @@ continue_processing: void packet_receive(struct wireguard_device *wg, struct sk_buff *skb) { size_t len, offset; -#ifdef DEBUG +#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) struct sockaddr_storage addr = { 0 }; socket_addr_from_skb(&addr, skb); #else @@ -75,7 +75,7 @@ void packet_send_handshake_cookie(struct wireguard_device *wg, struct sk_buff *i { struct message_handshake_cookie packet; -#ifdef DEBUG +#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) struct sockaddr_storage addr = { 0 }; socket_addr_from_skb(&addr, initiating_skb); net_dbg_ratelimited("Sending cookie response for denied handshake message for %pISpfsc\n", &addr); |