Skip to content

Commit c3bb2ff

Browse files
committed
Update icmp network name
1 parent 59e42c0 commit c3bb2ff

File tree

5 files changed

+7
-49
lines changed

5 files changed

+7
-49
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ require (
99
github.com/sagernet/gvisor v0.0.0-20250822052253-5558536cf237
1010
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a
1111
github.com/sagernet/nftables v0.3.0-beta.4
12-
github.com/sagernet/sing v0.7.6-0.20250825115037-1dbcbdf691a5
12+
github.com/sagernet/sing v0.7.6-0.20250825141840-811aa328e57b
1313
github.com/stretchr/testify v1.9.0
1414
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
1515
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8
1616
golang.org/x/net v0.43.0
1717
golang.org/x/sys v0.35.0
1818
)
1919

20+
replace github.com/sagernet/sing => ../sing
21+
2022
require (
2123
github.com/davecgh/go-spew v1.1.1 // indirect
2224
github.com/fsnotify/fsnotify v1.7.0 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZN
2424
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
2525
github.com/sagernet/nftables v0.3.0-beta.4 h1:kbULlAwAC3jvdGAC1P5Fa3GSxVwQJibNenDW2zaXr8I=
2626
github.com/sagernet/nftables v0.3.0-beta.4/go.mod h1:OQXAjvjNGGFxaTgVCSTRIhYB5/llyVDeapVoENYBDS8=
27-
github.com/sagernet/sing v0.7.6-0.20250825115037-1dbcbdf691a5 h1:ozQMu9iZGuSNdNaoBTy2E9ukYsE0uY4p9U0jA0CqrsM=
28-
github.com/sagernet/sing v0.7.6-0.20250825115037-1dbcbdf691a5/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
2927
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
3028
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
3129
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=

network_name.go

Lines changed: 0 additions & 42 deletions
This file was deleted.

stack_gvisor_icmp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (f *ICMPForwarder) HandlePacket(id stack.TransportEndpointID, pkt *stack.Pa
6161
if destinationAddr != f.inet4Address {
6262
action, err := f.mapping.Lookup(DirectRouteSession{Source: sourceAddr, Destination: destinationAddr}, func(timeout time.Duration) (DirectRouteDestination, error) {
6363
return f.handler.PrepareConnection(
64-
N.NetworkICMPv4,
64+
N.NetworkICMP,
6565
M.SocksaddrFrom(sourceAddr, 0),
6666
M.SocksaddrFrom(destinationAddr, 0),
6767
&ICMPBackWriter{
@@ -120,7 +120,7 @@ func (f *ICMPForwarder) HandlePacket(id stack.TransportEndpointID, pkt *stack.Pa
120120
if destinationAddr != f.inet6Address {
121121
action, err := f.mapping.Lookup(DirectRouteSession{Source: sourceAddr, Destination: destinationAddr}, func(timeout time.Duration) (DirectRouteDestination, error) {
122122
return f.handler.PrepareConnection(
123-
N.NetworkICMPv6,
123+
N.NetworkICMP,
124124
M.SocksaddrFrom(sourceAddr, 0),
125125
M.SocksaddrFrom(destinationAddr, 0),
126126
&ICMPBackWriter{

stack_system.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ func (s *System) processIPv4ICMP(ipHdr header.IPv4, icmpHdr header.ICMPv4) (bool
660660
if destinationAddr != s.inet4Address {
661661
action, err := s.directNat.Lookup(DirectRouteSession{Source: sourceAddr, Destination: destinationAddr}, func(timeout time.Duration) (DirectRouteDestination, error) {
662662
return s.handler.PrepareConnection(
663-
N.NetworkICMPv4,
663+
N.NetworkICMP,
664664
M.SocksaddrFrom(sourceAddr, 0),
665665
M.SocksaddrFrom(destinationAddr, 0),
666666
&systemICMPDirectPacketWriter4{s.tun, s.frontHeadroom + PacketOffset, sourceAddr},
@@ -732,7 +732,7 @@ func (s *System) processIPv6ICMP(ipHdr header.IPv6, icmpHdr header.ICMPv6) (bool
732732
if destinationAddr != s.inet6Address {
733733
action, err := s.directNat.Lookup(DirectRouteSession{Source: sourceAddr, Destination: destinationAddr}, func(timeout time.Duration) (DirectRouteDestination, error) {
734734
return s.handler.PrepareConnection(
735-
N.NetworkICMPv6,
735+
N.NetworkICMP,
736736
M.SocksaddrFrom(sourceAddr, 0),
737737
M.SocksaddrFrom(destinationAddr, 0),
738738
&systemICMPDirectPacketWriter6{s.tun, s.frontHeadroom + PacketOffset, sourceAddr},

0 commit comments

Comments
 (0)