go fmt
This commit is contained in:
parent
12e8158725
commit
2fcda8b90a
2
add.go
2
add.go
@ -1,6 +1,6 @@
|
||||
package dsnet
|
||||
|
||||
func Add(hostname string, owner string, description string) {//, publicKey string) {
|
||||
func Add(hostname string, owner string, description string) { //, publicKey string) {
|
||||
conf := MustLoadDsnetConfig()
|
||||
|
||||
privateKey := GenerateJSONPrivateKey()
|
||||
|
6
types.go
6
types.go
@ -2,12 +2,12 @@ package dsnet
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
"fmt"
|
||||
"errors"
|
||||
|
||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||
)
|
||||
@ -101,7 +101,7 @@ func (conf DsnetConfig) ChooseIP() (net.IP, error) {
|
||||
ones, bits := network.Mask.Size()
|
||||
zeros := bits - ones
|
||||
min := 1 // avoids network addr
|
||||
max := (1 << zeros) -2 // avoids broadcast addr + overflow
|
||||
max := (1 << zeros) - 2 // avoids broadcast addr + overflow
|
||||
|
||||
for i := min; i <= max; i++ {
|
||||
IP := make(net.IP, len(network.IP))
|
||||
|
Loading…
Reference in New Issue
Block a user