bugfix: loop breaks on error, should continue to next

This commit is contained in:
KusakabeSi 2021-09-23 22:44:40 +00:00
parent 34443127b9
commit 4d0b5d1a3f
4 changed files with 7 additions and 7 deletions

2
.vscode/launch.json vendored
View File

@ -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"*/],
}
]
}

View File

@ -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

View File

@ -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

View File

@ -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)
}