mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-18 17:55:51 +08:00
ipv6 fix for mobile apps
This commit is contained in:
parent
30309a4f9a
commit
dc84d90be2
1 changed files with 10 additions and 2 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
@ -878,6 +879,9 @@ func getUserRemoteAccessGwsV1(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
gws := userGws[node.Network]
|
||||
if net.ParseIP(extClient.IngressGatewayEndpoint).To16() != nil {
|
||||
extClient.IngressGatewayEndpoint = fmt.Sprintf("[%s]", extClient.IngressGatewayEndpoint)
|
||||
}
|
||||
extClient.AllowedIPs = logic.GetExtclientAllowedIPs(extClient)
|
||||
gws = append(gws, models.UserRemoteGws{
|
||||
GwID: node.ID.String(),
|
||||
|
@ -991,11 +995,15 @@ func getAllowedRagEndpoints(ragNode *models.Node, ragHost *models.Host) []string
|
|||
endpoints = append(endpoints, ragHost.EndpointIP.String())
|
||||
}
|
||||
if len(ragHost.EndpointIPv6) > 0 {
|
||||
endpoints = append(endpoints, ragHost.EndpointIPv6.String())
|
||||
endpoints = append(endpoints, fmt.Sprintf("[%s]", ragHost.EndpointIPv6.String()))
|
||||
}
|
||||
if servercfg.IsPro {
|
||||
for _, ip := range ragNode.AdditionalRagIps {
|
||||
endpoints = append(endpoints, ip.String())
|
||||
if ip.To16() != nil {
|
||||
endpoints = append(endpoints, fmt.Sprintf("[%s]", ip.String()))
|
||||
} else {
|
||||
endpoints = append(endpoints, ip.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
return endpoints
|
||||
|
|
Loading…
Add table
Reference in a new issue