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: use Duration type for PersistentKeepalive field in InterfaceWireguardPeer #234

Conversation

maksym-nazarenko
Copy link
Collaborator

Fixes #221

In MikroTik documentation, the persistent_keepalive is defined as Integer: A seconds interval, between 1 and 65535 inclusive.

In fact, after client sets it, in all subsequent reads this field becomes a duration:

Set value Read value
20 20s
123 2m3s
3602 1h2s

This PR changes PersistentKeepalive field type to our internal Duration type that can handle such normalizations.

@maksym-nazarenko maksym-nazarenko added bug Something isn't working client labels Jun 29, 2024
@maksym-nazarenko maksym-nazarenko self-assigned this Jun 29, 2024
@maksym-nazarenko maksym-nazarenko merged commit e7e63a5 into ddelnano:master Jul 9, 2024
4 of 5 checks passed
@maksym-nazarenko maksym-nazarenko deleted the fix-wireguard-peer-persistent_keepalive branch July 9, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wireguard endpoint port and keepalives don't work
2 participants