However, the actual size of a UDP packet includes:
IV: 16 bytes (e.g., for aes-128-gcm)
Destination address: 7~258 bytes (depending on IPv4/IPv6/domain)
Payload: variable, up to 2048 bytes
AEAD authentication tag: 16 bytes
When the incoming payload is large (close to 2048 bytes), the total size exceeds the buffer capacity. When b.Extend() is called in AEADCipher.EncodePacket() to allocate space for the authentication tag, it triggers panic: extending out of bound, causing the process to crash.
Fix
Before creating the buffer, calculate the required buffer size based on IV length, maximum address length (258 bytes), payload length, and AEAD overhead (16 bytes). If the required size exceeds the default buffer size (2048 bytes), use buf.NewWithSize() to allocate a sufficiently large buffer.
* proxy dns with NOTIMP error
* fix compile error when protoc is relative link
```
$ go generate
...
proto.go
fork/exec ../Cellar/protobuf/28.3/bin/protoc: no such file or directory
exit status 1
proto.go:5: running "go": exit status 1
context_test.go
functions_test.go
v2ray_test.go
$ ls -l `which protoc`
lrwxr-xr-x 1 local admin 34 Nov 1 13:56 /opt/homebrew/bin/protoc -> ../Cellar/protobuf/28.3/bin/protoc
```
* add nonIPQuery for dns config
* go generate with only dns.proto
* Try Allowing Github actions
* fix merge error
* apply coding style
---------
Co-authored-by: local <local@localhost>
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
Postpone SOCKS server ok reply to a TCP Connect command until Dispatch()
actually creates an upstream Link. Previously it was sent immediately
inside Handshake(). UDP works as before.
The hysteria2 fork used "github.com/JimmyHuang454/hysteria" removed the original license of hysteria2 (which is not allowed) and replaced it with GPL which conflicts with v2ray's license.
Given that the quality of the related code is very poor and it is not synchronized with the upstream, I deleted it.
* Shadowsocks2022 Client Implementation Improvements
1. Added UDP Replay Detection
2. Added UDP Processor State Cache
3. Added More Detailed Output for Time Difference Error
4. Replaced Mutex with RWMutex for reduced lock contention
5. Added per server session tracking of decryption cache and anti-replay window
6. Adjust server session track time
7. Increase per session buffer to 128
8. Fix client crash when EIH is not enabled
9. Fix client log contains non-human-friendly content
10.Remove mark and remove for trackedSessions
11. Fixed packet size uint16 overflow issue
* Move `filterIP` from `hosts.go` to `dnscommon.go`
* Implement adding pools for fakedns.HolderMulti
* Implement per-client fakedns for DNS app
* Remove `dns.ClientWithIPOption` and replace with new programming model
* Implement JSON config support for new fakedns config
* Fix lint and tests
* Fix some codacy analysis