mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2024-11-21 23:03:08 +01:00
bugfix: loop breaks on error, should continue to next
This commit is contained in:
parent
34443127b9
commit
4d0b5d1a3f
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -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"*/],
|
||||
}
|
||||
]
|
||||
}
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user