Improve OpenVPN & OpenConnect interoperability

This commit is contained in:
世界
2026-07-21 09:38:21 +08:00
parent 5cad5ad42d
commit 2ff294c4f4
47 changed files with 3915 additions and 440 deletions
+3 -3
View File
@@ -102,7 +102,7 @@ func (d *stackDevice) UpdateConfiguration(configuration Configuration) error {
d.stateAccess.Lock()
defer d.stateAccess.Unlock()
if d.logRouteOptions && hasRouteOptions(configuration.Routes) {
d.options.Logger.Debug("OpenVPN route gateway and metric options are not representable by the gVisor stack device; routes are installed by prefix")
d.options.Logger.Debug("route gateway and metric options are not representable by the gVisor stack device; routes are installed by prefix")
d.logRouteOptions = false
}
if configuration.MTU != 0 {
@@ -184,7 +184,7 @@ func (d *stackDevice) writeBuffers(packetBuffers []*buf.Buffer) error {
func (d *stackDevice) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error) {
if destination.IsIPv6() && d.blockIPv6Enabled() {
return nil, E.New("IPv6 blocked by pushed OpenVPN block-ipv6")
return nil, E.New("IPv6 blocked by pushed block-ipv6")
}
inet4Address, inet6Address := d.PortAddresses()
address := tcpip.FullAddress{
@@ -221,7 +221,7 @@ func (d *stackDevice) DialContext(ctx context.Context, network string, destinati
func (d *stackDevice) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error) {
if destination.IsIPv6() && d.blockIPv6Enabled() {
return nil, E.New("IPv6 blocked by pushed OpenVPN block-ipv6")
return nil, E.New("IPv6 blocked by pushed block-ipv6")
}
inet4Address, inet6Address := d.PortAddresses()
bind := tcpip.FullAddress{