mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-13 04:24:53 +08:00
fixing client issues for uspace, fwmark, vpn
This commit is contained in:
@@ -28,19 +28,15 @@ func RunCmdFormatted(command string, printerr bool) (string, error) {
|
||||
}
|
||||
|
||||
// CreateUserSpaceConf - creates a user space WireGuard conf
|
||||
func CreateUserSpaceConf(address string, privatekey string, listenPort string, mtu int32, fwmark int32, perskeepalive int32, peers []wgtypes.PeerConfig) (string, error) {
|
||||
func CreateUserSpaceConf(address string, privatekey string, listenPort string, mtu int32, perskeepalive int32, peers []wgtypes.PeerConfig) (string, error) {
|
||||
peersString, err := parsePeers(perskeepalive, peers)
|
||||
var listenPortString string
|
||||
var fwmarkString string
|
||||
if mtu <= 0 {
|
||||
mtu = 1280
|
||||
}
|
||||
if listenPort != "" {
|
||||
listenPortString += "ListenPort = " + listenPort
|
||||
}
|
||||
if fwmark != 0 {
|
||||
fwmarkString += "FWMark = " + strconv.Itoa(int(fwmark))
|
||||
}
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -49,7 +45,6 @@ Address = %s
|
||||
PrivateKey = %s
|
||||
MTU = %s
|
||||
%s
|
||||
%s
|
||||
|
||||
%s
|
||||
|
||||
@@ -58,7 +53,6 @@ MTU = %s
|
||||
privatekey,
|
||||
strconv.Itoa(int(mtu)),
|
||||
listenPortString,
|
||||
fwmarkString,
|
||||
peersString)
|
||||
return config, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user