aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-11-29 04:47:27 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-12-05 11:48:25 +0100
commite1d3e7635f3fd22ec216805a22f63e8002863af8 (patch)
treec633665f394d5ae511a4ee668816cbe0766329d9 /src/send.c
parentsend: use kfree_skb_list (diff)
downloadwireguard-monolithic-historical-e1d3e7635f3fd22ec216805a22f63e8002863af8.tar.xz
wireguard-monolithic-historical-e1d3e7635f3fd22ec216805a22f63e8002863af8.zip
device: prepare skb_list_walk_safe for upstreaming
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/send.c b/src/send.c
index 3da27d6..9b54f4a 100644
--- a/src/send.c
+++ b/src/send.c
@@ -233,10 +233,6 @@ void wg_packet_send_keepalive(struct wg_peer *peer)
wg_packet_send_staged_packets(peer);
}
-#define skb_walk_null_queue_safe(first, skb, next) \
- for (skb = first, next = skb->next; skb; \
- skb = next, next = skb ? skb->next : NULL)
-
static void wg_packet_create_data_done(struct sk_buff *first,
struct wg_peer *peer)
{
@@ -245,7 +241,7 @@ static void wg_packet_create_data_done(struct sk_buff *first,
wg_timers_any_authenticated_packet_traversal(peer);
wg_timers_any_authenticated_packet_sent(peer);
- skb_walk_null_queue_safe(first, skb, next) {
+ skb_list_walk_safe(first, skb, next) {
is_keepalive = skb->len == message_data_len(0);
if (likely(!wg_socket_send_skb_to_peer(peer, skb,
PACKET_CB(skb)->ds) && !is_keepalive))
@@ -295,7 +291,7 @@ void wg_packet_encrypt_worker(struct work_struct *work)
while ((first = ptr_ring_consume_bh(&queue->ring)) != NULL) {
enum packet_state state = PACKET_STATE_CRYPTED;
- skb_walk_null_queue_safe(first, skb, next) {
+ skb_list_walk_safe(first, skb, next) {
if (likely(encrypt_packet(skb,
PACKET_CB(first)->keypair,
&simd_context))) {