diff --git a/.vscode/launch.json b/.vscode/launch.json index 5a6bdde..05a4a37 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "program": "${workspaceFolder}", "buildFlags": "-tags=vpp", "env": {"CGO_CFLAGS":"-I/usr/include/memif"}, - "args":["-config","example_config/super_mode/s1.yaml","-mode","super"/*,"-example"*/], + "args":["-config","tttttttttt.yaml","-mode","edge"/*,"-example"*/], } ] } \ No newline at end of file diff --git a/README.md b/README.md index d4e0c18..0c890cd 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Install Go 1.16 ```bash add-apt-repository ppa:longsleep/golang-backports apt-get -y update -apt-install -y wireguard-tools golang-go build-essential +apt-get install -y wireguard-tools golang-go build-essential git ``` Build diff --git a/README_zh.md b/README_zh.md index 6277fc1..b2ad992 100644 --- a/README_zh.md +++ b/README_zh.md @@ -128,7 +128,7 @@ Usage of ./etherguard-go-vpp: ```bash add-apt-repository ppa:longsleep/golang-backports apt-get -y update -apt-install -y wireguard-tools golang-go build-essential +apt-get install -y wireguard-tools golang-go build-essential git ``` Build diff --git a/device/receivesendproc.go b/device/receivesendproc.go index d50c200..db6e842 100644 --- a/device/receivesendproc.go +++ b/device/receivesendproc.go @@ -166,7 +166,7 @@ func (device *Device) process_received(msg_type path.Usage, peer *Peer, body []b return } -func (device *Device) sprint_received(msg_type path.Usage, body []byte) (string) { +func (device *Device) sprint_received(msg_type path.Usage, body []byte) string { switch msg_type { case path.Register: if content, err := path.ParseRegisterMsg(body); err == nil { @@ -390,12 +390,12 @@ func (device *Device) process_UpdatePeerMsg(peer *Peer, content path.UpdatePeerM for PubKey, peerinfo := range peer_infos { if len(peerinfo.Connurl) == 0 { - return nil + continue } sk, err := Str2PubKey(PubKey) if err != nil { device.log.Errorf("Error decode base64:", err) - return err + continue } if bytes.Equal(sk[:], device.staticIdentity.publicKey[:]) { continue @@ -418,7 +418,7 @@ func (device *Device) process_UpdatePeerMsg(peer *Peer, content path.UpdatePeerM pk, err := Str2PSKey(peerinfo.PSKey) if err != nil { device.log.Errorf("Error decode base64:", err) - return err + continue } thepeer.SetPSK(pk) }