MindFlavor / prometheus_wireguard_exporter

A Prometheus exporter for WireGuard, written in Rust.
https://mindflavor.github.io/prometheus_wireguard_exporter
MIT License
493 stars 51 forks source link

Cannot listen on an IPv6 address #23

Closed foxcpp closed 4 years ago

foxcpp commented 4 years ago

What I do

prometheus_wireguard_exporter -l ::1

What I expect

Exporter listening on IPv6 loopback.

What I get

prometheus_wireguard_exporter[112947]: [2020-03-23T22:37:50Z INFO  prometheus_wireguard_exporter] using options: Options { verbose: false, separate_allowed_ips: false, extract_names_config_file: None, export_remote_ip_and_port: false }
prometheus_wireguard_exporter[112947]: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: AddrParseError(())', src/main.rs:159:14
prometheus_wireguard_exporter[112947]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Notes

My use-case is not specifically IPv6 loopback but any IPv6 address since I have IPv6-only VPN.

MindFlavor commented 4 years ago

That's my fault, I've used the Ipv4-only struct while parsing the command line. There is no reason for doing this, I'll put together a bugfix PR soon (should be a one line change).

MindFlavor commented 4 years ago

@foxcpp : can you please test if the PR https://github.com/MindFlavor/prometheus_wireguard_exporter/pull/24 solves your issue?

foxcpp commented 4 years ago

Yes, it does. Thanks.

MindFlavor commented 4 years ago

Thanks! I'll merge the PR and create a new release shortly!