Skip to content

Commit

Permalink
Merge pull request #120 from gardener/fix/ping-seq-16bit
Browse files Browse the repository at this point in the history
Fix ping failure due to overflow in sequence number check
  • Loading branch information
MartinWeindel authored Dec 9, 2024
2 parents 4f7f726 + 7172d86 commit 1a24e3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Please see [Reversed VPN Tunnel Setup and Configuration](https://github.com/gard
*Note: Remember the image name reported at the end similar to*

```txt
VPN client image: localhost:5001/europe-docker_pkg_dev_gardener-project_public_gardener_vpn-client:0.26.0-dev
VPN client image: localhost:5001/europe-docker_pkg_dev_gardener-project_public_gardener_vpn-client:0.33.0-dev
```

**VPN server image**
Expand All @@ -76,22 +76,22 @@ Please see [Reversed VPN Tunnel Setup and Configuration](https://github.com/gard
*Note: Remember the image name reported at the end similar to*

```txt
VPN server image: localhost:5001/europe-docker_pkg_dev_gardener-project_public_gardener_vpn-server:0.26.0-dev
VPN server image: localhost:5001/europe-docker_pkg_dev_gardener-project_public_gardener_vpn-server:0.33.0-dev
```

- adjust the image vector file `imagevector/images.yaml` in Gardener to image repositories and tags provided by the last step
- adjust the image vector file `imagevector/containers.yaml` in Gardener to image repositories and tags provided by the last step

```
...
- name: vpn-server
sourceRepository: github.com/gardener/vpn2
repository: localhost:5001/europe-docker_pkg_dev_gardener-project_public_gardener_vpn-server
tag: 0.26.0-dev
tag: 0.33.0-dev
...
- name: vpn-client
sourceRepository: github.com/gardener/vpn2
repository: localhost:5001/europe-docker_pkg_dev_gardener-project_public_gardener_vpn-client
tag: 0.26.0-dev
tag: 0.33.0-dev
...
```

Expand Down
4 changes: 2 additions & 2 deletions cmd/vpn_client/app/pathcontroller/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func (p *icmpPinger) ping(client net.IP) error {
return fmt.Errorf("error setting deadline: %w", err)
}

seq := p.lastSeq.Add(1)
seq := p.lastSeq.Add(1) & 0xffff // is marshalled as uint16 so we need to mask it
msg := icmp.Message{
Type: ipv6.ICMPTypeEchoRequest,
Code: 0,
Body: &icmp.Echo{
ID: os.Getpid() & 0xffff,
ID: os.Getpid() & 0xffff, // is marshalled as uint16 so we need to mask it
Seq: int(seq),
Data: []byte(echoPayload),
},
Expand Down

0 comments on commit 1a24e3b

Please sign in to comment.