Commit Graph
1089 Commits
Author SHA1 Message Date
Yaroslav Gurov 45fa148913 chore: empty default obfuscators 2026-01-09 02:25:01 +00:00
Yaroslav Gurov b25e2b6ab4 chore: longer human-readable names 2026-01-08 13:18:23 +00:00
Yaroslav Gurov 5715abd559 chore: uapi adjustments 2026-01-08 13:01:17 +00:00
Yaroslav Gurov 861b341f54 chore: stream read cleanup 2026-01-07 20:32:50 +00:00
Yaroslav Gurov 5f04c25146 feat: uapi support of fmt_in, fmt_out, and proper network fields 2026-01-07 16:24:14 +00:00
Yaroslav Gurov dc283472b5 chore: change bind sequence on windows 2026-01-07 16:22:32 +00:00
Yaroslav Gurov ec6d9a5f21 chore: multibind optimizations 2026-01-07 16:22:05 +00:00
Yaroslav Gurov 40e318c76e feat: buffer write operations for ObfuscatedConn 2025-12-20 09:17:33 +00:00
Yaroslav Gurov fecfe69b7b chore: use buffer pool in ObfuscatedConn instead of the original one buf 2025-12-20 08:52:36 +00:00
Yaroslav Gurov bb8270bcfa feat: make obf packets work in stream; initial support of obfuscated connections 2025-12-20 07:44:16 +00:00
Yaroslav Gurov 997f578a9b feat: initial support of StreamObfuscators 2025-12-19 07:51:47 +00:00
Yaroslav Gurov 497de26f78 feat: initial support of Multibind and UAPI configuration 2025-12-19 05:43:36 +00:00
Yaroslav Gurov 030539bcf7 chore: use io.ReadFull instead of plain net.Conn.Read 2025-12-18 19:26:29 +00:00
Yaroslav Gurov e19237981d feat: [exp] added size information in front of each packet 2025-12-18 16:58:47 +00:00
Yaroslav Gurov 2791bea913 chore: safe handling of new connections 2025-12-18 03:27:52 +00:00
Yaroslav Gurov 787b2f6bbd chore: initialize stream on send only 2025-12-18 00:52:26 +00:00
Yaroslav Gurov f139b29094 feat: initial fwmark support for stream connections 2025-12-18 00:52:26 +00:00
Yaroslav Gurov d42bdde6da feat: rework stream listener 2025-12-18 00:52:26 +00:00
Yaroslav Gurov f867e4dba7 feat: resolve domain immediately while on configuration stage 2025-12-18 00:52:26 +00:00
Yaroslav Gurov b7f3497a8c feat: add syncronization and protection 2025-12-18 00:52:26 +00:00
Yaroslav Gurov f0b5c51c4d feat: add tcp bind 2025-12-18 00:52:26 +00:00
Yaroslav Gurov 449d7cffd4 Feature/outline glue (#106)
* feat: added outline integration layer

* chore: make the function used in RegisterFallbackParser a standalone one

* fix: check if domain has a dot prior trimming it

* fix: use net.JoinHostPort instead of plain concat
2025-12-19 03:14:48 +01:00
vkamn e796d477d8 chore: update license (#105)
Signed-off-by: vkamn <vk@amnezia.org>
2025-12-11 18:56:42 +08:00
Yaroslav Gurov 730d6c39d0 chore: add docs for the params from awg2 v0.2.16 2025-12-01 13:11:33 +01:00
Yaroslav Gurov 0361c54dca fix: refactor processing of junk packets (#103)
- fix the bug that transport packet interprets as init/resp/cookie with the same size
- cleanup error responses
- reduce buffer allocations
2025-12-01 20:07:48 +08:00
Mark PuhaandYaroslav Gurov f6542209f4 feat: awg 2.0 (#91)
* feat: ranged H1-H4
* feat: S3, S4 support
* chore: updated awg-tools version

---------

Co-authored-by: Yaroslav Gurov <ygurov@proton.me>
v0.2.15
2025-09-01 14:04:52 +02:00
pokamest 1abd24b5b9 Merge pull request #85 from amnezia-vpn/hotfix/docker-script
fix: restore Dockerfile changes
v0.2.13
2025-07-07 16:20:58 +03:00
Yaroslav Gurov 3f19f1c657 fix: restore Dockerfile 2025-07-07 15:15:29 +02:00
Mykola Baibuz c207898480 AmneziaWG v1.5 (#84) 2025-07-07 13:34:51 +01:00
pokamest fe75b639fa Merge pull request #78 from jmwample/jmwample/upstream
Sync with Major Upstream changes
v0.2.13-beta-awg-1.5-fix3
2025-07-02 03:01:39 +01:00
jmwample 169ed49a46 fix formatting discrepancy 2025-06-23 14:56:43 -06:00
Jason A. Donenfeld eeb8aae13e version: bump snapshot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:56:43 -06:00
Jason A. Donenfeld 99f2e6d66f conn: don't enable GRO on Linux < 5.12
Kernels below 5.12 are missing this:

    commit 98184612aca0a9ee42b8eb0262a49900ee9eef0d
    Author: Norman Maurer <norman_maurer@apple.com>
    Date:   Thu Apr 1 08:59:17 2021

        net: udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...);

        Support for UDP_GRO was added in the past but the implementation for
        getsockopt was missed which did lead to an error when we tried to
        retrieve the setting for UDP_GRO. This patch adds the missing switch
        case for UDP_GRO

        Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
        Signed-off-by: Norman Maurer <norman_maurer@apple.com>
        Reviewed-by: David Ahern <dsahern@kernel.org>
        Signed-off-by: David S. Miller <davem@davemloft.net>

That means we can't set the option and then read it back later. Given
how buggy UDP_GRO is in general on odd kernels, just disable it on older
kernels all together.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:56:43 -06:00
Jason A. Donenfeld d5359f52f0 device: add support for removing allowedips individually
This pairs with the recent change in wireguard-tools.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:56:43 -06:00
Jason A. Donenfeld 6768090667 version: bump snapshot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:56:43 -06:00
Kurnia D Win 2cad62c40b rwcancel: fix wrong poll event flag on ReadyWrite
It should be POLLIN because closeFd is read-only file.

Signed-off-by: Kurnia D Win <kurnia.d.win@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:27:20 -06:00
Tom Holford 8051f17147 device: use rand.NewSource instead of rand.Seed
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:27:06 -06:00
Tom Holford ace3e11ef2 global: replaced unused function params with _
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:26:55 -06:00
ruokeqx 8a2b2bf4f4 tun: darwin: fetch flags and mtu from if_msghdr directly
Signed-off-by: ruokeqx <ruokeqx@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:26:37 -06:00
Tu Dinh Ngoc 75d6c67a67 tun: use add-with-carry in checksumNoFold()
Use parallel summation with native byte order per RFC 1071.
add-with-carry operation is used to add 4 words per operation.  Byteswap
is performed before and after checksumming for compatibility with old
`checksumNoFold()`.  With this we get a 30-80% speedup in `checksum()`
depending on packet sizes.

Add unit tests with comparison to a per-word implementation.

**Intel(R) Xeon(R) Silver 4210R CPU @ 2.40GHz**

| Size | OldTime | NewTime | Speedup  |
|------|---------|---------|----------|
| 64   | 12.64   | 9.183   | 1.376456 |
| 128  | 18.52   | 12.72   | 1.455975 |
| 256  | 31.01   | 18.13   | 1.710425 |
| 512  | 54.46   | 29.03   | 1.87599  |
| 1024 | 102     | 52.2    | 1.954023 |
| 1500 | 146.8   | 81.36   | 1.804326 |
| 2048 | 196.9   | 102.5   | 1.920976 |
| 4096 | 389.8   | 200.8   | 1.941235 |
| 8192 | 767.3   | 413.3   | 1.856521 |
| 9000 | 851.7   | 448.8   | 1.897727 |
| 9001 | 854.8   | 451.9   | 1.891569 |

**AMD EPYC 7352 24-Core Processor**

| Size | OldTime | NewTime | Speedup  |
|------|---------|---------|----------|
| 64   | 9.159   | 6.949   | 1.318031 |
| 128  | 13.59   | 10.59   | 1.283286 |
| 256  | 22.37   | 14.91   | 1.500335 |
| 512  | 41.42   | 24.22   | 1.710157 |
| 1024 | 81.59   | 45.05   | 1.811099 |
| 1500 | 120.4   | 68.35   | 1.761522 |
| 2048 | 162.8   | 90.14   | 1.806079 |
| 4096 | 321.4   | 180.3   | 1.782585 |
| 8192 | 650.4   | 360.8   | 1.802661 |
| 9000 | 706.3   | 398.1   | 1.774177 |
| 9001 | 712.4   | 398.2   | 1.789051 |

Signed-off-by: Tu Dinh Ngoc <dinhngoc.tu@irit.fr>
[Jason: simplified and cleaned up unit tests]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:26:25 -06:00
Jason A. Donenfeld ac8a885a03 tun/netstack: cleanup network stack at closing time
Colin's commit went a step further and protected tun.incomingPacket with
a lock on shutdown, but let's see if the tun.stack.Close() call actually
solves that on its own.

Suggested-by: kshangx <hikeshang@hotmail.com>
Suggested-by: Colin Adler <colin1adler@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:26:07 -06:00
Jason A. Donenfeld 6a7c878409 tun/netstack: remove usage of pkt.IsNil()
Since 3c75945fd ("netstack: remove PacketBuffer.IsNil()") this has been
invalid. Follow the replacement pattern of that commit.

The old definition inlined to the same code anyway:

 func (pk *PacketBuffer) IsNil() bool {
 	return pk == nil
 }

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:25:57 -06:00
Jason A. Donenfeld 704d57c27a mod: bump deps
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:25:36 -06:00
Jason A. Donenfeld c0b6e6a200 global: bump copyright notice
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:20:32 -06:00
Jordan Whited c803ce1e5b device: fix missed return of QueueOutboundElementsContainer to its WaitPool
Fixes: 3bb8fec ("conn, device, tun: implement vectorized I/O plumbing")
Reviewed-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:18:41 -06:00
Jordan Whited deedce495a device: fix WaitPool sync.Cond usage
The sync.Locker used with a sync.Cond must be acquired when changing
the associated condition, otherwise there is a window within
sync.Cond.Wait() where a wake-up may be missed.

Fixes: 4846070 ("device: use a waiting sync.Pool instead of a channel")
Reviewed-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:18:28 -06:00
pokamest 27e661d68e Merge pull request #70 from marko1777/junk-improvements
Junk improvements
2025-04-07 15:31:41 +01:00
Mark Puha 71be0eb3a6 faster and more secure junk creation 2025-03-18 08:34:23 +01:00
pokamest e3f1273f8a Merge pull request #64 from drkivi/master
Patch for golang crypto and net submodules
2025-02-18 11:50:35 +00:00
drkivi c97b5b7615 Update go.sum
Signed-off-by: drkivi <115035277+drkivi@users.noreply.github.com>
2025-02-10 21:44:58 +03:30