Feature implementation from commits 29e37e8..2d3126b#5
Feature implementation from commits 29e37e8..2d3126b#5codeOwlAI wants to merge 15 commits intofeature-base-branch-5from
Conversation
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.37.0 to 0.38.0. - [Commits](golang/net@v0.37.0...v0.38.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…rors during server initialization (XTLS#4566) XTLS#4566 (comment)
Completes XTLS#1677 --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
Announcement of NFTs by Project X: XTLS#3633 Project X NFT: https://opensea.io/assets/ethereum/0x5ee362866001613093361eb8569d59c4141b76d1/1 XHTTP: Beyond REALITY: XTLS#4113 REALITY NFT: https://opensea.io/assets/ethereum/0x5ee362866001613093361eb8569d59c4141b76d1/2
Bumps [github.com/miekg/dns](https://github.com/miekg/dns) from 1.1.64 to 1.1.65. - [Changelog](https://github.com/miekg/dns/blob/master/Makefile.release) - [Commits](miekg/dns@v1.1.64...v1.1.65) --- updated-dependencies: - dependency-name: github.com/miekg/dns dependency-version: 1.1.65 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.71.0 to 1.71.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.71.0...v1.71.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.31.0 to 0.32.0. - [Commits](golang/sys@v0.31.0...v0.32.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-version: 0.32.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.12.0 to 0.13.0. - [Commits](golang/sync@v0.12.0...v0.13.0) --- updated-dependencies: - dependency-name: golang.org/x/sync dependency-version: 0.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.36.0 to 0.37.0. - [Commits](golang/crypto@v0.36.0...v0.37.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.37.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…shalJSON (XTLS#4585) * conf: implement MarshalJSON for FakeDNSConfig * conf: Rewrite MarshalJSON for PortList decouple PortRange from PortList. * conf: implement MarshalJSON for HostAddress * conf: Add MarshalJSON comments and use pointers.
| func (v PortList) MarshalJSON() ([]byte, error) { | ||
| return json.Marshal(v.String()) | ||
| // MarshalJSON implements encoding/json.Marshaler.MarshalJSON | ||
| func (v *PortList) MarshalJSON() ([]byte, error) { |
There was a problem hiding this comment.
🐛 Correctness Issue
Breaking API Change: Receiver Type Changed.
Changed from value receiver to pointer receiver which breaks backward compatibility for any code calling MarshalJSON on non-pointer values.
Current Code (Diff):
- func (v *PortList) MarshalJSON() ([]byte, error) {
+ func (v PortList) MarshalJSON() ([]byte, error) {📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| func (v *PortList) MarshalJSON() ([]byte, error) { | |
| func (v PortList) MarshalJSON() ([]byte, error) { |
| port, err := strconv.Atoi(portStr) | ||
| if err == nil { | ||
| return json.Marshal(port) | ||
| } else { | ||
| return json.Marshal(portStr) | ||
| } |
There was a problem hiding this comment.
🐛 Correctness Issue
Inconsistent JSON Type Serialization.
The new implementation creates inconsistent JSON types where single ports become numbers while ranges become strings, which can break clients expecting consistent types.
Current Code (Diff):
- port, err := strconv.Atoi(portStr)
- if err == nil {
- return json.Marshal(port)
- } else {
- return json.Marshal(portStr)
- }
+ return json.Marshal(portStr)📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| port, err := strconv.Atoi(portStr) | |
| if err == nil { | |
| return json.Marshal(port) | |
| } else { | |
| return json.Marshal(portStr) | |
| } | |
| return json.Marshal(portStr) |
| tun.stack.RemoveNIC(1) | ||
|
|
||
| if tun.events != nil { | ||
| close(tun.events) |
There was a problem hiding this comment.
🐛 Correctness Issue
Potential panic on nil channel close.
Removing the nil check before closing channels can cause a panic if Close() is called before the channels are initialized.
Current Code (Diff):
- close(tun.events)
+ if tun.events != nil {
+ close(tun.events)
+ }📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| close(tun.events) | |
| if tun.events != nil { | |
| close(tun.events) | |
| } |
| tun.ep.Close() | ||
|
|
||
| if tun.incomingPacket != nil { | ||
| close(tun.incomingPacket) |
There was a problem hiding this comment.
🐛 Correctness Issue
Potential panic on nil channel close.
Removing the nil check before closing incomingPacket channel can cause a panic if Close() is called before the channel is initialized.
Current Code (Diff):
- close(tun.incomingPacket)
+ if tun.incomingPacket != nil {
+ close(tun.incomingPacket)
+ }📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
| close(tun.incomingPacket) | |
| if tun.incomingPacket != nil { | |
| close(tun.incomingPacket) | |
| } |
PR Summary
Core Version Update and Network Configuration Enhancements
Overview
This PR updates the core version value, enhances configuration error handling, and improves network interface binding functionality across different platforms.
Change Types
Affected Modules
core.goconf/common.goconf/xray.gowireguard/gvisortun/tun.gointernet/sockopt_darwin.gointernet/sockopt_windows.goNotes for Reviewers