wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* Bug in helper contrib/examples/reresolve-dns/reresolve-dns.sh
@ 2019-11-26 22:40 Conrad Meyer
  2019-11-27 12:31 ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Conrad Meyer @ 2019-11-26 22:40 UTC (permalink / raw)
  To: wireguard

Hi,

reresolve-dns.sh seems to have a bug where interfaces with more than a
single peer configured do not match the output of "latest-handshakes"
correctly.  Chiefly, the ^ and $ regex anchors in the script match on
the full, multiline output of 'wg foo latest-handshakes' in bash,
rather than matching on individual lines (which is clearly the
intent).

This is observed on both bash 4.4.23 and 5.0.11.

The easiest fix to this problem is simply to remove the anchors.
There should be no issue with false positive matching, nor correctly
parsing the last handshake time.  With this minor change,
reresolve-dns.sh actually functions on my host with two peers
configured.

I did not spot any obvious way to change bash's regex line-matching
behavior.  If that exists, it may be preferable.

Thank you,
Conrad
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-27 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 22:40 Bug in helper contrib/examples/reresolve-dns/reresolve-dns.sh Conrad Meyer
2019-11-27 12:31 ` Jason A. Donenfeld
2019-11-27 18:23   ` Conrad Meyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).