<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body wsmode="compose" text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>in some circumstances it is important <span id="result_box"
class="short_text" lang="en"><span class=""></span></span>to set
the TOS field in tunnel packet equivalent to payload packet TOS.</p>
<p>for example, our provider supports three different SLAs,
depending on packet TOS field, with different jitter,</p>
<p>packet loss and service availability. In current release
wireguard always set tos to 0.</p>
<p>This patch solves that problem.<br>
</p>
<p><br>
</p>
<p>--- send.c.orig 2017-10-17 20:26:29.000000000 +0300<br>
+++ send.c 2018-01-08 15:10:25.364428109 +0300<br>
@@ -302,7 +302,7 @@<br>
* all of the packets in the queue. If we can't assign
nonces for all of them,<br>
* we just consider it a failure and wait for the next
handshake. */<br>
skb_queue_walk (&packets, skb) {<br>
- PACKET_CB(skb)->ds = ip_tunnel_ecn_encap(0 /*
No outer TOS: no leak. TODO: should we use flowi->tos as outer?
*/, ip_hdr(skb), skb);<br>
+ PACKET_CB(skb)->ds =
ip_tunnel_ecn_encap(ipv4_get_dsfield(ip_hdr(skb)) &
~INET_ECN_MASK, ip_hdr(skb), skb);<br>
PACKET_CB(skb)->nonce =
atomic64_inc_return(&key->counter.counter) - 1;<br>
if (unlikely(PACKET_CB(skb)->nonce >=
REJECT_AFTER_MESSAGES))<br>
goto out_invalid;<br>
<br>
</p>
</body>
</html>