mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-27 05:26:56 +00:00
Fix omitempty for JSON struct fields
Claude-Session: https://claude.ai/code/session_01NxBrtZjwwaJC8uxCNbgmKu
This commit is contained in:
@@ -405,11 +405,11 @@ func buildClientDataChannelOptions(options option.OpenVPNClientEndpointOptions)
|
||||
}
|
||||
|
||||
func buildClientTunnelOptions(options option.OpenVPNClientEndpointOptions, requirePeerAddress bool) (ovpn.ClientTunnelOptions, error) {
|
||||
vpnGateway := netip.Addr(options.PeerAddress)
|
||||
vpnGateway := options.PeerAddress.Build(netip.Addr{})
|
||||
if vpnGateway.IsValid() && !vpnGateway.Is4() {
|
||||
return ovpn.ClientTunnelOptions{}, E.New("`peer_address` must be an IPv4 address")
|
||||
}
|
||||
vpnGatewayIPv6 := netip.Addr(options.PeerAddressIPv6)
|
||||
vpnGatewayIPv6 := options.PeerAddressIPv6.Build(netip.Addr{})
|
||||
if vpnGatewayIPv6.IsValid() && !vpnGatewayIPv6.Is6() {
|
||||
return ovpn.ClientTunnelOptions{}, E.New("`peer_address_ipv6` must be an IPv6 address")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user