You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] WireGuard backend renders IPv6 peer endpoints without brackets #443
Describe the bug
When a WireGuard peer's endpoint_host is an IPv6 address, the WireGuard backend renders Endpoint without square brackets, which wg rejects.
Expected behavior Endpoint = [2001:db8::1]:51820 (WireGuard requires brackets for IPv6 endpoints, see wg(8)).
Cause netjsonconfig/backends/wireguard/converters.py builds the value as f"{host}:{port}".
The OpenWrt backend is not affected because it writes host and port as separate UCI options.
Possible fix
Add the brackets when endpoint_host is an IPv6 address (and strip them when parsing).
I noticed this while working on #441, which adds the WireGuard parser; since the fix touches the
same converter, I'd send it after #441, if this is confirmed.
Activity
[fix] Added brackets to IPv6 endpoints in WireGuard backend openwisp#443
[fix] Added brackets to IPv6 endpoints in WireGuard backend openwisp#443
[fix] Added brackets to IPv6 endpoints in WireGuard backend openwisp#443