Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ping failure due to overflow in sequence number check #120

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading