summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2023-09-26 15:16:45 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2023-09-26 15:16:45 +0000
commit0c2bd22686bcdb39e8429ca8bacab62480d287d8 (patch)
tree124edae80ffa559d15284040826ca998e058cb85 /sys/net
parented14d24a0dabccfbea612ca3277ce03cb4d47b71 (diff)
Have wg(4) copy the priority from the inner packet to the outer encrypted
packet, so that higher priority packets are picked from hfsc queues for earlier transmission. (Does not copy ToS bits from inner to outer packet headers sent on the wire, which some may regard as secret). tested by Andrew Lemin, ok dlg@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_wg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c
index 889d93acd0e..856759977da 100644
--- a/sys/net/if_wg.c
+++ b/sys/net/if_wg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wg.c,v 1.30 2023/09/24 05:56:06 yasuoka Exp $ */
+/* $OpenBSD: if_wg.c,v 1.31 2023/09/26 15:16:44 sthen Exp $ */
/*
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
@@ -1528,6 +1528,8 @@ wg_encap(struct wg_softc *sc, struct mbuf *m)
*/
mc->m_pkthdr.ph_flowid = m->m_pkthdr.ph_flowid;
+ mc->m_pkthdr.pf.prio = m->m_pkthdr.pf.prio;
+
res = noise_remote_encrypt(&peer->p_remote, &data->r_idx, &nonce,
data->buf, plaintext_len);
nonce = htole64(nonce); /* Wire format is little endian. */