Improve parsing of ping6(1) output
commita80eafbf9cab9d80c526c504edf2ee4446a072d9
authorHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 11 Jun 2012 21:40:04 +0000 (11 23:40 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 11 Jun 2012 21:40:04 +0000 (11 23:40 +0200)
tree505a6caeb312d63e8b2d9f1814c9b2e807258d51
parent4e9eedc8debe1388996bd5631f2df6e057854061
Improve parsing of ping6(1) output

The ping6(1) implementation provided by Debian's iputils-ping package
may produce output such as the following:

| 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms

There's a corresponding pattern in check_ping.c:458:

| "%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss"

Without this fix, the pattern in check_ping.c:456 matched first (as
sscanf(3) interprets "+3" as a match for "%d"):

| "%*d packets transmitted, %*d received, %d%% loss, time"

(#1894850 - Debian bug report #514588 - Matej Vela)
NEWS
THANKS.in
plugins/check_ping.c