Plugin Commandline showing issues:
check_ping -H [invalid-ipv6-address] -w 5000,100% -c 5000,100% -p 1
Debian GNU/Linux 4.0 (etch)
Debian's ping6 may produce output in the following format:
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms
There's a corresponding pattern in check_ping.c:450:
"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss"
but the pattern in check_ping.c:448 matches first:
"%*d packets transmitted, %*d received, %d%% loss, time"
because sscanf interprets "+3" as a match for "%d". Although the rest
of the pattern doesn't match, the number of successful assignments
(and thus the return value of sscanf) is still 1.
A simple way to make sure the whole pattern matches is to add a "%n"
specifier at the end, which will assign the number of characters
matched by that point. (The same trick is used in check_http.c.)
There seems to be some confusion whether "%n" affects the return value
of sscanf, so it's safer to check the assigned number of characters.