Repository: cloudflare/boringtun (language: rust)

Issue:
tx_bytes and rx_bytes are reversed in the API



Discussion / hints:

Fix patch:
diff --git a/src/device/api.rs b/src/device/api.rs
index a5ea6d42..3db68f45 100644
--- a/src/device/api.rs
+++ b/src/device/api.rs
@@ -158,8 +158,8 @@ fn api_get(writer: &mut BufWriter<&UnixStream>, d: &Device) -> i32 {
 
         let (_, tx_bytes, rx_bytes, ..) = p.tunnel.stats();
 
-        writeln!(writer, "rx_bytes={}", tx_bytes);
-        writeln!(writer, "tx_bytes={}", rx_bytes);
+        writeln!(writer, "rx_bytes={}", rx_bytes);
+        writeln!(writer, "tx_bytes={}", tx_bytes);
     }
     0
 }


Test patch: