Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#705900: check_ping fail if host do not have IPv6 address

93 views
Skip to first unread message

Petter Reinholdtsen

unread,
Apr 21, 2013, 6:30:01 PM4/21/13
to

Package: nagios-plugins-basic
Version: 1.4.16-1
Severity: important
User: debia...@lists.debian.org
Usertags: debian-edu

In Debian Edu, we use check_ping from the nagios-plugins-basic package
to check if a host is responding. The Nagios configuration is generated
using the sitesummary package.

With the Wheezy version of Debian Edu, the check_ping nagios plugin
started to fail, and I tracked it down to the fact that check_ping try
to use ping6 to reach the host in question, while earlier it used ping.

The DNS host name in question only resolve to an IPv4 address, but ping6
is tried nevertheless:

root@tjener:~# host tjener.intern
tjener.intern has address 10.0.2.2
root@tjener:~# /usr/lib/nagios/plugins/check_ping -H tjener.intern -w 10,10% -c 10,10%
/bin/ping6 -n -U -w 10 -c 5 tjener.intern
CRITICAL - Could not interpret output from ping command
root@tjener:~#

The issue seem to be similar to the ones reported in
<URL: http://bugs.debian.org/597068 > and
<URL: http://bugs.debian.org/629640 >, but those reports seem to be
related to problems with hosts where AAAA records are present. This is
not the case here.

Could you please change check_ping to use IPv4 ping if no AAAA entry is
present in DNS?

--
Happy hacking
Petter Reinholdtsen


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Jan Wagner

unread,
Apr 22, 2013, 3:10:02 AM4/22/13
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tag 705900 + moreinfo unreproducible
thanks

Hi Petter,

thanks for taking time to reporting your issue.

Am 22.04.2013 00:22, schrieb Petter Reinholdtsen:
> The DNS host name in question only resolve to an IPv4 address, but ping6
> is tried nevertheless:
>
> root@tjener:~# host tjener.intern
> tjener.intern has address 10.0.2.2
> root@tjener:~# /usr/lib/nagios/plugins/check_ping -H tjener.intern -w 10,10% -c 10,10%
> /bin/ping6 -n -U -w 10 -c 5 tjener.intern
> CRITICAL - Could not interpret output from ping command
> root@tjener:~#

I tried to reproduce your problem on an i386 and amd64 system, but all
worked as expected:

waja@bodengruppe:~$ dpkg -l | grep nagios-plugins-basic
ii nagios-plugins-basic 1.4.16-1 amd64 Plugins for nagios compatible monitoring systems
waja@bodengruppe:~$ /usr/lib/nagios/plugins/check_ping -vvv -H test.test.org -w 10,10% -c 10,10%
CMD: /bin/ping -n -U -w 10 -c 5 test.test.org
Output: PING test.test.org (127.0.0.1) 56(84) bytes of data.
Output: 64 bytes from 127.0.0.1: icmp_req=1 ttl=64 time=0.020 ms
Output: 64 bytes from 127.0.0.1: icmp_req=2 ttl=64 time=0.029 ms
Output: 64 bytes from 127.0.0.1: icmp_req=3 ttl=64 time=0.034 ms
Output: 64 bytes from 127.0.0.1: icmp_req=4 ttl=64 time=0.032 ms
Output: 64 bytes from 127.0.0.1: icmp_req=5 ttl=64 time=0.037 ms
Output:
Output: --- test.test.org ping statistics ---
Output: 5 packets transmitted, 5 received, 0% packet loss, time 3997ms
Output: rtt min/avg/max/mdev = 0.020/0.030/0.037/0.007 ms
PING OK - Packet loss = 0%, RTA = 0.03 ms|rta=0.030000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
10.000000:10% 10.000000:10%

waja@bb:~$ dpkg -l | grep nagios-plugins-basic
ii nagios-plugins-basic 1.4.16-1 i386 Plugins for nagios compatible monitoring systems
waja@bb:~$ /usr/lib/nagios/plugins/check_ping -vvv -H test.test.org -w 10,10% -c 10,10%
CMD: /bin/ping -n -U -w 10 -c 5 test.test.org
Output: PING test.test.org (127.0.0.1) 56(84) bytes of data.
Output: 64 bytes from 127.0.0.1: icmp_req=1 ttl=64 time=0.027 ms
Output: 64 bytes from 127.0.0.1: icmp_req=2 ttl=64 time=0.032 ms
Output: 64 bytes from 127.0.0.1: icmp_req=3 ttl=64 time=0.040 ms
Output: 64 bytes from 127.0.0.1: icmp_req=4 ttl=64 time=0.046 ms
Output: 64 bytes from 127.0.0.1: icmp_req=5 ttl=64 time=0.044 ms
Output:
Output: --- test.test.org ping statistics ---
Output: 5 packets transmitted, 5 received, 0% packet loss, time 3997ms
Output: rtt min/avg/max/mdev = 0.027/0.037/0.046/0.010 ms
PING OK - Packet loss = 0%, RTA = 0.04 ms|rta=0.037000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
10.000000:10% 10.000000:10%

> The issue seem to be similar to the ones reported in
> <URL: http://bugs.debian.org/597068 > and
> <URL: http://bugs.debian.org/629640 >, but those reports seem to be
> related to problems with hosts where AAAA records are present. This is
> not the case here.
>
> Could you please change check_ping to use IPv4 ping if no AAAA entry is
> present in DNS?

Right from the sourcecode of the plugin:

"#ifdef PING6_COMMAND
if (address_family != AF_INET && is_inet6_addr(addresses[i]))
rawcmd = strdup(PING6_COMMAND);
else
rawcmd = strdup(PING_COMMAND);
#else
rawcmd = strdup(PING_COMMAND);
#endif"

Looks not bad.

If you can give me more informations, maybe I can dig into it.

Many thanks, Jan.
- --
Never write mail to <wa...@spamfalle.info>, you have been warned!
- -----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS
PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++
- ------END GEEK CODE BLOCK------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iD8DBQFRdOFD9u6Dud+QFyQRArwmAKDVsIC997YpSJ2bcTIoNYdV8FIrigCfSMCv
RXrXWAVdBzt5BlAYomQ0Keg=
=Rvu1
-----END PGP SIGNATURE-----

Petter Reinholdtsen

unread,
Apr 22, 2013, 3:30:03 AM4/22/13
to
[Jan Wagner]
> If you can give me more informations, maybe I can dig into it.

I would be happy to, if you have suggestions to what kind of
information to collect.

--
Happy hacking
Petter Reinholdtsen


Jan Wagner

unread,
Apr 22, 2013, 3:40:01 AM4/22/13
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 22.04.2013 09:23, schrieb Petter Reinholdtsen:
> [Jan Wagner]
>> If you can give me more informations, maybe I can dig into it.
>
> I would be happy to, if you have suggestions to what kind of
> information to collect.

Could you please test "/usr/lib/nagios/plugins/check_ping -vvv -H
test.test.org -w 10,10% -c 10,10%" ... just to be sure.

Thanks, Jan.
- --
Never write mail to <wa...@spamfalle.info>, you have been warned!
- -----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V-
PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++
- ------END GEEK CODE BLOCK------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iD8DBQFRdOic9u6Dud+QFyQRAsexAKDQGw78WXSgeZHvELmfsxkeiZOj+QCfZuPZ
cd4cSmg8Q+5IPAoTgCOFus4=
=hx8S
-----END PGP SIGNATURE-----

Petter Reinholdtsen

unread,
Apr 22, 2013, 4:40:01 AM4/22/13
to
[Jan Wagner]
> Could you please test "/usr/lib/nagios/plugins/check_ping -vvv -H
> test.test.org -w 10,10% -c 10,10%" ... just to be sure.

The machine do not have internet connectivity by default. I tried
this first:

root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H tjener.intern -w 10,10% -c 10,10%
CMD: /bin/ping6 -n -U -w 10 -c 5 tjener.intern
Got stderr: connect: Invalid argument
/bin/ping6 -n -U -w 10 -c 5 tjener.intern
CRITICAL - Could not interpret output from ping command
root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H test.test.org -w 10,10% -c 10,10%
check_ping: Invalid hostname/address - test.test.org
Usage:
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
[-p packets] [-t timeout] [-4|-6]
root@tjener:~#

Then I fixed internet routing and tried again to test.test.org:

root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H test.test.org -w 10,10% -c 10,10%
CMD: /bin/ping -n -U -w 10 -c 5 test.test.org
Output: PING test.test.org (127.0.0.1) 56(84) bytes of data.
Output: 64 bytes from 127.0.0.1: icmp_req=1 ttl=64 time=0.119 ms
Output: 64 bytes from 127.0.0.1: icmp_req=2 ttl=64 time=0.042 ms
Output: 64 bytes from 127.0.0.1: icmp_req=3 ttl=64 time=0.041 ms
Output: 64 bytes from 127.0.0.1: icmp_req=4 ttl=64 time=0.041 ms
Output: 64 bytes from 127.0.0.1: icmp_req=5 ttl=64 time=0.042 ms
Output:
Output: --- test.test.org ping statistics ---
Output: 5 packets transmitted, 5 received, 0% packet loss, time 3999ms
Output: rtt min/avg/max/mdev = 0.041/0.057/0.119/0.031 ms
PING OK - Packet loss = 0%, RTA = 0.06 ms|rta=0.057000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
10.000000:10% 10.000000:10%
root@tjener:~#

No idea what is going on here, nor how they are different.

Here is some more network related settings:

root@tjener:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search intern
root@tjener:~# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

10.0.2.2 tjener.intern tjener
root@tjener:~# /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 54:52:00:1f:e6:59
inet addr:10.0.2.2 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::5652:ff:fe1f:e659/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:802 errors:0 dropped:0 overruns:0 frame:0
TX packets:679 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:100939 (98.5 KiB) TX bytes:74412 (72.6 KiB)
Interrupt:10 Base address:0xe000

eth0:1 Link encap:Ethernet HWaddr 54:52:00:1f:e6:59
inet addr:192.168.1.201 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:10 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3430 errors:0 dropped:0 overruns:0 frame:0
TX packets:3430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:727599 (710.5 KiB) TX bytes:727599 (710.5 KiB)

root@tjener:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@tjener:~#

--
Happy hacking
Petter Reinholdtsen


Jan Wagner

unread,
Apr 22, 2013, 5:40:02 AM4/22/13
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

severity 705900 minor
thanks

Hi Petter,

many thanks for your verbose informations.

Am 22.04.2013 10:32, schrieb Petter Reinholdtsen:
> [Jan Wagner]
>> Could you please test "/usr/lib/nagios/plugins/check_ping -vvv
>> -H test.test.org -w 10,10% -c 10,10%" ... just to be sure.
>
> The machine do not have internet connectivity by default. I tried
> this first:
>
> root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H
> tjener.intern -w 10,10% -c 10,10% CMD: /bin/ping6 -n -U -w 10 -c 5
> tjener.intern Got stderr: connect: Invalid argument /bin/ping6 -n
> -U -w 10 -c 5 tjener.intern CRITICAL - Could not interpret output
> from ping command

Hmm ... this is really strange!

> root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H
> test.test.org -w 10,10% -c 10,10% check_ping: Invalid
> hostname/address - test.test.org Usage: check_ping -H
> <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>% [-p packets] [-t
> timeout] [-4|-6] root@tjener:~#

Okay .. without network this seems really feasible.

> Then I fixed internet routing and tried again to test.test.org:
>
> root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H
> test.test.org -w 10,10% -c 10,10% CMD: /bin/ping -n -U -w 10 -c 5
> test.test.org Output: PING test.test.org (127.0.0.1) 56(84) bytes
> of data. Output: 64 bytes from 127.0.0.1: icmp_req=1 ttl=64
> time=0.119 ms Output: 64 bytes from 127.0.0.1: icmp_req=2 ttl=64
> time=0.042 ms Output: 64 bytes from 127.0.0.1: icmp_req=3 ttl=64
> time=0.041 ms Output: 64 bytes from 127.0.0.1: icmp_req=4 ttl=64
> time=0.041 ms Output: 64 bytes from 127.0.0.1: icmp_req=5 ttl=64
> time=0.042 ms Output: Output: --- test.test.org ping statistics
> --- Output: 5 packets transmitted, 5 received, 0% packet loss, time
> 3999ms Output: rtt min/avg/max/mdev = 0.041/0.057/0.119/0.031 ms
> PING OK - Packet loss = 0%, RTA = 0.06
> ms|rta=0.057000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
> 10.000000:10% 10.000000:10% root@tjener:~#

Okay ... that's whet I expected. Nice to see that it works.

> No idea what is going on here, nor how they are different.

Okay .. I did put "tjener.intern" into my /etc/hosts as 127.0.0.1:

waja@bb:~$ grep tjener.intern /etc/hosts
127.0.0.1 localhost tjener.intern
waja@bb:~$ /usr/lib/nagios/plugins/check_ping -vvv -H tjener.intern -w
10,10% -c 10,10%
CMD: /bin/ping -n -U -w 10 -c 5 tjener.intern
Output: PING localhost (127.0.0.1) 56(84) bytes of data.
Output: 64 bytes from 127.0.0.1: icmp_req=1 ttl=64 time=0.025 ms
Output: 64 bytes from 127.0.0.1: icmp_req=2 ttl=64 time=0.038 ms
Output: 64 bytes from 127.0.0.1: icmp_req=3 ttl=64 time=0.051 ms
Output: 64 bytes from 127.0.0.1: icmp_req=4 ttl=64 time=0.042 ms
Output: 64 bytes from 127.0.0.1: icmp_req=5 ttl=64 time=0.047 ms
Output:
Output: --- localhost ping statistics ---
Output: 5 packets transmitted, 5 received, 0% packet loss, time 3998ms
Output: rtt min/avg/max/mdev = 0.025/0.040/0.051/0.011 ms
PING OK - Packet loss = 0%, RTA = 0.04
ms|rta=0.040000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
10.000000:10% 10.000000:10%

Looks like it's working and I'm actually convinced, that the source of
your trouble is somewhere outside of the nagios-plugins package. Fore
sure even if it turns out it is, so it seems just 'minor'.

Just out of curiosity, could you please try to use "check_ping -4 ..."?

Many thanks, Jan.
- --
Never write mail to <wa...@spamfalle.info>, you have been warned!
- -----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V-
PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++
- ------END GEEK CODE BLOCK------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iD8DBQFRdQJi9u6Dud+QFyQRAsT3AJ45Kpc9KPZNO2/uDrvCfulIYI9ODQCeJ4dZ
dWqzraGEvUaTPY97hGrwxmE=
=n//n
-----END PGP SIGNATURE-----

Petter Reinholdtsen

unread,
Apr 22, 2013, 6:00:02 AM4/22/13
to
reassign 705900 libnss-myhostname
found 705900 0.3-4
severity 705900 important
thanks

[Jan Wagner]
> Looks like it's working and I'm actually convinced, that the source
> of your trouble is somewhere outside of the nagios-plugins package.

Hm, I guess you are right. See below.

It is not DNS related, and it is not related to the content of
/etc/hosts (I tried to remove every line and the problem still
existed). This is the output from 'dig for the two test cases:


root@tjener:~# dig tjener.intern

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> tjener.intern
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16044
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;tjener.intern. IN A

;; ANSWER SECTION:
tjener.intern. 500 IN A 10.0.2.2

;; AUTHORITY SECTION:
intern. 500 IN NS tjener.intern.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr 22 11:39:42 2013
;; MSG SIZE rcvd: 61

root@tjener:~# dig test.test.com

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> test.test.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55751
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;test.test.com. IN A

;; ANSWER SECTION:
test.test.com. 5073 IN A 174.36.85.72

;; AUTHORITY SECTION:
test.com. 170672 IN NS ns65.worldnic.com.
test.com. 170672 IN NS ns66.worldnic.com.

;; ADDITIONAL SECTION:
ns65.worldnic.com. 170672 IN A 205.178.190.33
ns66.worldnic.com. 170672 IN A 206.188.198.33

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr 22 11:39:48 2013
;; MSG SIZE rcvd: 126

root@tjener:~#


> Fore sure even if it turns out it is, so it seems just 'minor'.

Well, it is a important problem for Debian Edu, as the default school
setup will start with a Nagios warning about the school server being
down. :)

> Just out of curiosity, could you please try to use "check_ping -4 ..."?

root@tjener:~# /usr/lib/nagios/plugins/check_ping -4 -vvv -H tjener.intern -w 10,10% -c 10,10%CMD: /bin/ping -n -U -w 10 -c 5 tjener.intern
Output: PING tjener.intern (10.0.2.2) 56(84) bytes of data.
Output: 64 bytes from 10.0.2.2: icmp_req=1 ttl=64 time=0.134 ms
Output: 64 bytes from 10.0.2.2: icmp_req=2 ttl=64 time=0.043 ms
Output: 64 bytes from 10.0.2.2: icmp_req=3 ttl=64 time=0.046 ms
Output: 64 bytes from 10.0.2.2: icmp_req=4 ttl=64 time=0.046 ms
Output: 64 bytes from 10.0.2.2: icmp_req=5 ttl=64 time=0.045 ms
Output:
Output: --- tjener.intern ping statistics ---
Output: 5 packets transmitted, 5 received, 0% packet loss, time 3998ms
Output: rtt min/avg/max/mdev = 0.043/0.062/0.134/0.037 ms
PING OK - Packet loss = 0%, RTA = 0.06 ms|rta=0.062000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
10.000000:10% 10.000000:10%
root@tjener:~#


Here is strace from the failing check_ping run:

root@tjener:~# strace /usr/lib/nagios/plugins/check_ping -vvv -H tjener.intern -w 10,10% -c 10,10%
execve("/usr/lib/nagios/plugins/check_ping", ["/usr/lib/nagios/plugins/check_pi"..., "-vvv", "-H", "tjener.intern", "-w", "10,10%", "-c", "10,10%"], [/* 23 vars */]) = 0
brk(0) = 0xb8612000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b1000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117917, ...}) = 0
mmap2(NULL, 117917, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7794000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libnsl.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P1\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=79728, ...}) = 0
mmap2(NULL, 92136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb777d000
mmap2(0xb7790000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12) = 0xb7790000
mmap2(0xb7792000, 6120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7792000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P&\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=71488, ...}) = 0
mmap2(NULL, 79944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7769000
mmap2(0xb7779000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0xb7779000
mmap2(0xb777b000, 6216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb777b000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220L\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=117009, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7768000
mmap2(NULL, 98816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb774f000
mmap2(0xb7764000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0xb7764000
mmap2(0xb7766000, 4608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7766000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9844, ...}) = 0
mmap2(NULL, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb774b000
mmap2(0xb774d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb774d000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240o\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1437864, ...}) = 0
mmap2(NULL, 1452408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75e8000
mprotect(0xb7744000, 4096, PROT_NONE) = 0
mmap2(0xb7745000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb7745000
mmap2(0xb7748000, 10616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7748000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75e7000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb75e7940, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7745000, 8192, PROT_READ) = 0
mprotect(0xb774d000, 4096, PROT_READ) = 0
mprotect(0xb7764000, 4096, PROT_READ) = 0
mprotect(0xb7779000, 4096, PROT_READ) = 0
mprotect(0xb7790000, 4096, PROT_READ) = 0
mprotect(0xb77de000, 4096, PROT_READ) = 0
mprotect(0xb77d0000, 4096, PROT_READ) = 0
munmap(0xb7794000, 117917) = 0
set_tid_address(0xb75e79a8) = 17084
set_robust_list(0xb75e79b0, 0xc) = 0
futex(0xbfe53330, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, bfe53340) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0xb77536e0, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xb7753b70, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="tjener.intern", ...}) = 0
brk(0) = 0xb8612000
brk(0xb8633000) = 0xb8633000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1535104, ...}) = 0
mmap2(NULL, 1535104, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7470000
close(3) = 0
socket(PF_NETLINK, SOCK_RAW, 0) = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=17084, groups=00000000}, [12]) = 0
time(NULL) = 1366623970
sendto(3, "\24\0\0\0\26\0\1\3\342\6uQ\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\342\6uQ\274B\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 168
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\342\6uQ\274B\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\342\6uQ\274B\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(3) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
close(3) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
close(3) = 0
open("/etc/nsswitch.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=703, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 1024) = 703
read(3, "", 1024) = 0
close(3) = 0
munmap(0xb77b0000, 4096) = 0
open("/etc/host.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
read(3, "multi on\n", 1024) = 9
read(3, "", 1024) = 0
close(3) = 0
munmap(0xb77b0000, 4096) = 0
futex(0xb7749b44, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/etc/resolv.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
read(3, "# Dynamic resolv.conf(5) file fo"..., 4096) = 186
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb77b0000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117917, ...}) = 0
mmap2(NULL, 117917, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7794000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_files.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\32\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=42628, ...}) = 0
mmap2(NULL, 45768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7464000
mmap2(0xb746e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9) = 0xb746e000
close(3) = 0
mprotect(0xb746e000, 4096, PROT_READ) = 0
munmap(0xb7794000, 117917) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=295, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
read(3, "127.0.0.1 localhost.locald"..., 1024) = 295
read(3, "", 1024) = 0
close(3) = 0
munmap(0xb77b0000, 4096) = 0
rt_sigaction(SIGALRM, {0xb77d79c0, [ALRM], SA_RESTART}, {SIG_DFL, [], 0}, 8) = 0
alarm(11) = 0
socket(PF_NETLINK, SOCK_RAW, 0) = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=17084, groups=00000000}, [12]) = 0
time(NULL) = 1366623970
sendto(3, "\24\0\0\0\26\0\1\3\342\6uQ\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\342\6uQ\274B\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 168
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\342\6uQ\274B\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\342\6uQ\274B\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(3) = 0
stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
open("/etc/resolv.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
read(3, "# Dynamic resolv.conf(5) file fo"..., 4096) = 186
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb77b0000, 4096) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=295, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
read(3, "127.0.0.1 localhost.locald"..., 1024) = 295
read(3, "", 1024) = 0
close(3) = 0
munmap(0xb77b0000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117917, ...}) = 0
mmap2(NULL, 117917, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7794000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libnss_myhostname.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\t\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9844, ...}) = 0
mmap2(NULL, 12700, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7460000
mmap2(0xb7463000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7463000
close(3) = 0
munmap(0xb7794000, 117917) = 0
uname({sys="Linux", node="tjener.intern", ...}) = 0
socket(PF_NETLINK, SOCK_DGRAM, 0) = 3
setsockopt(3, SOL_SOCKET, SO_PASSCRED, [1], 4) = 0
send(3, "\21\0\0\0\26\0\5\3g\22\0\0\0\0\0\0\0", 17, 0) = 17
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"0\0\0\0\24\0\2\0g\22\0\0\274B\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 16408}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=0, uid=0, gid=0}}, msg_flags=0}, 0) = 168
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"@\0\0\0\24\0\2\0g\22\0\0\274B\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 16408}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=0, uid=0, gid=0}}, msg_flags=0}, 0) = 128
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\24\0\0\0\3\0\2\0g\22\0\0\274B\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 16408}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=0, uid=0, gid=0}}, msg_flags=0}, 0) = 20
close(3) = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77b0000
write(1, "CMD: /bin/ping6 -n -U -w 10 -c 5"..., 47CMD: /bin/ping6 -n -U -w 10 -c 5 tjener.intern
) = 47
SYS_340(0, 0x4, 0, 0xbfe51220, 0xb7746ff4) = 0
SYS_340(0, 0x4, 0xbfe51220, 0, 0xb7746ff4) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=4*1024}) = 0
pipe([3, 4]) = 0
pipe([5, 6]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb75e79a8) = 17085
close(4) = 0
fcntl64(3, F_GETFL) = 0 (flags O_RDONLY)
fstat64(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77af000
_llseek(3, 0, 0xbfe5109c, SEEK_CUR) = -1 ESPIPE (Illegal seek)
close(6) = 0
fcntl64(5, F_GETFL) = 0 (flags O_RDONLY)
fstat64(5, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77ae000
_llseek(5, 0, 0xbfe5110c, SEEK_CUR) = -1 ESPIPE (Illegal seek)
read(3, "", 4096) = 0
read(5, "connect: Invalid argument\n", 4096) = 26
write(1, "Got stderr: connect: Invalid arg"..., 38Got stderr: connect: Invalid argument
) = 38
open("/usr/share/locale/locale.alias", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77ad000
read(4, "# Locale name alias data base.\n#"..., 1024) = 1024
read(4, " entries are case independent.\n\n"..., 1024) = 1024
read(4, "eucKR\nko_KR\t\tko_KR.eucKR\nlithuan"..., 1024) = 522
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb77ad000, 4096) = 0
open("/usr/share/locale/nb_NO/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nb/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nb_NO.ISO-8859-1/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nb_NO.iso88591/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nb.ISO-8859-1/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nb.iso88591/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/no/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nn_NO/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/nn/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/da/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/sv/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/nagios-plugins.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
read(5, "", 4096) = 0
close(5) = 0
munmap(0xb77ae000, 4096) = 0
close(3) = 0
munmap(0xb77af000, 4096) = 0
waitpid(17085, [{WIFEXITED(s) && WEXITSTATUS(s) == 2}], 0) = 17085
--- SIGCHLD (Child exited) @ 0 (0) ---
write(1, "/bin/ping6 -n -U -w 10 -c 5 tjen"..., 42/bin/ping6 -n -U -w 10 -c 5 tjener.intern
) = 42
write(1, "CRITICAL - Could not interpret o"..., 56CRITICAL - Could not interpret output from ping command
) = 56
exit_group(3) = ?
root@tjener:~#

Hm, perhaps the problem is related to libnss-myhostname? Testing with
getent indicate that it might be related:

root@tjener:~# getent hosts tjener.intern
fe80::5652:ff:fe1f:e659 tjener.intern
root@tjener:~#

I tried to remove it, and then the check worked:

root@tjener:~# /usr/lib/nagios/plugins/check_ping -vvv -H tjener.intern -w 10,10% -c 10,10%
CMD: /bin/ping -n -U -w 10 -c 5 tjener.intern
Output: PING tjener.intern (10.0.2.2) 56(84) bytes of data.
Output: 64 bytes from 10.0.2.2: icmp_req=1 ttl=64 time=0.124 ms
Output: 64 bytes from 10.0.2.2: icmp_req=2 ttl=64 time=0.040 ms
Output: 64 bytes from 10.0.2.2: icmp_req=3 ttl=64 time=0.042 ms
Output: 64 bytes from 10.0.2.2: icmp_req=4 ttl=64 time=0.042 ms
Output: 64 bytes from 10.0.2.2: icmp_req=5 ttl=64 time=0.048 ms
Output:
Output: --- tjener.intern ping statistics ---
Output: 5 packets transmitted, 5 received, 0% packet loss, time 3998ms
Output: rtt min/avg/max/mdev = 0.040/0.059/0.124/0.032 ms
PING OK - Packet loss = 0%, RTA = 0.06 ms|rta=0.059000ms;10.000000;10.000000;0.000000 pl=0%;10;10;0
10.000000:10% 10.000000:10%
root@tjener:~#

Reassigning to that package, as it probably should not return any IPv6
link-local address by default.

--
Happy hacking
Petter Reinholdtsen


Joachim Breitner

unread,
Apr 22, 2013, 7:00:02 AM4/22/13
to
Hi,

thanks for the bug report. I’m curious: In

root@tjener:~# host tjener.intern
tjener.intern has address 10.0.2.2
root@tjener:~# /usr/lib/nagios/plugins/check_ping -H tjener.intern -w 10,10% -c 10,10%
/bin/ping6 -n -U -w 10 -c 5 tjener.intern
CRITICAL - Could not interpret output from ping command
root@tjener:~#

Why exactly does it fail if the local hostname resolves to an IPv6
address? Because ping6 is not installed? Or
because /usr/lib/nagios/plugins/check_ping does not understand the
output?


Greetings,
Joachim


--
Joachim "nomeata" Breitner
Debian Developer
nom...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
JID: nom...@joachim-breitner.de | http://people.debian.org/~nomeata

signature.asc

Petter Reinholdtsen

unread,
Apr 22, 2013, 7:10:02 AM4/22/13
to
[Joachim Breitner]
> Why exactly does it fail if the local hostname resolves to an IPv6
> address? Because ping6 is not installed? Or because
> /usr/lib/nagios/plugins/check_ping does not understand the output?

I do not know. ping6 is installed, but the command fail. This is the
output from ping6:

root@tjener:~# ping6 fe80::5652:ff:fe1f:e659
connect: Invalid argument
root@tjener:~#

And here is the same using strace:

root@tjener:~# strace ping6 fe80::5652:ff:fe1f:e659
execve("/bin/ping6", ["ping6", "fe80::5652:ff:fe1f:e659"], [/* 23 vars */]) = 0
brk(0) = 0x970b000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77ce000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117803, ...}) = 0
mmap2(NULL, 117803, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb77b1000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P&\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=71488, ...}) = 0
mmap2(NULL, 79944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb779d000
mmap2(0xb77ad000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0xb77ad000
mmap2(0xb77af000, 6216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb77af000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\217\4\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1812104, ...}) = 0
mmap2(NULL, 1828080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75de000
mprotect(0xb7781000, 4096, PROT_NONE) = 0
mmap2(0xb7782000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb7782000
mmap2(0xb779a000, 9456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb779a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240o\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1437864, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75dd000
mmap2(NULL, 1452408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb747a000
mprotect(0xb75d6000, 4096, PROT_NONE) = 0
mmap2(0xb75d7000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb75d7000
mmap2(0xb75da000, 10616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb75da000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9844, ...}) = 0
mmap2(NULL, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7476000
mmap2(0xb7478000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7478000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\33\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=95896, ...}) = 0
mmap2(NULL, 98556, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb745d000
mmap2(0xb7474000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xb7474000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb745c000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb745c8d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7474000, 4096, PROT_READ) = 0
mprotect(0xb7478000, 4096, PROT_READ) = 0
mprotect(0xb75d7000, 8192, PROT_READ) = 0
mprotect(0xb7782000, 61440, PROT_READ) = 0
mprotect(0xb77ad000, 4096, PROT_READ) = 0
mprotect(0xb77ed000, 4096, PROT_READ) = 0
munmap(0xb77b1000, 117803) = 0
socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6) = 3
getuid32() = 0
setuid32(0) = 0
socket(PF_NETLINK, SOCK_RAW, 0) = 4
bind(4, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(4, {sa_family=AF_NETLINK, pid=26652, groups=00000000}, [12]) = 0
time(NULL) = 1366628242
sendto(4, "\24\0\0\0\26\0\1\3\222\27uQ\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\222\27uQ\34h\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 168
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\222\27uQ\34h\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\222\27uQ\34h\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(4) = 0
brk(0) = 0x970b000
brk(0x972c000) = 0x972c000
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET6, sin6_port=htons(1025), inet_pton(AF_INET6, "fe80::5652:ff:fe1f:e659", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EINVAL (Invalid argument)
dup(2) = 5
fcntl64(5, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(5, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77cd000
_llseek(5, 0, 0xbfbe8f98, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(5, "connect: Invalid argument\n", 26connect: Invalid argument
) = 26
close(5) = 0
munmap(0xb77cd000, 4096) = 0
exit_group(2) = ?
root@tjener:~#

Petter Reinholdtsen

unread,
Apr 22, 2013, 7:30:02 AM4/22/13
to
[Petter Reinholdtsen]
> I do not know. ping6 is installed, but the command fail. This is
> the output from ping6:
>
> root@tjener:~# ping6 fe80::5652:ff:fe1f:e659
> connect: Invalid argument
> root@tjener:~#

Ah, wrong argument. I know why it fail now. check_ping uses NSS to
look up the hostname, while ping6 uses DNS.

root@tjener:~# ping6 tjener.intern
unknown host
root@tjener:~#

And NSS and DNS do not agree in this case, causing ping6 to fail when
called from check_ping.

Here is the strace:

root@tjener:~# strace ping6 tjener.intern
execve("/bin/ping6", ["ping6", "tjener.intern"], [/* 23 vars */]) = 0
brk(0) = 0x9fbc000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76e7000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117803, ...}) = 0
mmap2(NULL, 117803, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb76ca000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P&\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=71488, ...}) = 0
mmap2(NULL, 79944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb76b6000
mmap2(0xb76c6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0xb76c6000
mmap2(0xb76c8000, 6216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb76c8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\217\4\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1812104, ...}) = 0
mmap2(NULL, 1828080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb74f7000
mprotect(0xb769a000, 4096, PROT_NONE) = 0
mmap2(0xb769b000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb769b000
mmap2(0xb76b3000, 9456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb76b3000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240o\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1437864, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb74f6000
mmap2(NULL, 1452408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7393000
mprotect(0xb74ef000, 4096, PROT_NONE) = 0
mmap2(0xb74f0000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb74f0000
mmap2(0xb74f3000, 10616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb74f3000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9844, ...}) = 0
mmap2(NULL, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb738f000
mmap2(0xb7391000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7391000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\33\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=95896, ...}) = 0
mmap2(NULL, 98556, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7376000
mmap2(0xb738d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xb738d000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7375000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb73758d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb738d000, 4096, PROT_READ) = 0
mprotect(0xb7391000, 4096, PROT_READ) = 0
mprotect(0xb74f0000, 8192, PROT_READ) = 0
mprotect(0xb769b000, 61440, PROT_READ) = 0
mprotect(0xb76c6000, 4096, PROT_READ) = 0
mprotect(0xb7706000, 4096, PROT_READ) = 0
munmap(0xb76ca000, 117803) = 0
socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6) = 3
getuid32() = 0
setuid32(0) = 0
socket(PF_NETLINK, SOCK_RAW, 0) = 4
bind(4, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(4, {sa_family=AF_NETLINK, pid=29504, groups=00000000}, [12]) = 0
time(NULL) = 1366629539
sendto(4, "\24\0\0\0\26\0\1\3\243\34uQ\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\243\34uQ@s\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 168
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\243\34uQ@s\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\243\34uQ@s\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(4) = 0
brk(0) = 0x9fbc000
brk(0x9fdd000) = 0x9fdd000
getpid() = 29504
open("/etc/resolv.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76e6000
read(4, "# Dynamic resolv.conf(5) file fo"..., 4096) = 186
read(4, "", 4096) = 0
close(4) = 0
munmap(0xb76e6000, 4096) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
close(4) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
close(4) = 0
open("/etc/nsswitch.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=692, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76e6000
read(4, "# /etc/nsswitch.conf\n#\n# Example"..., 1024) = 692
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb76e6000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=117803, ...}) = 0
mmap2(NULL, 117803, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb76ca000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\32\0\0004\0\0\0"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0644, st_size=42628, ...}) = 0
mmap2(NULL, 45768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb7369000
mmap2(0xb7373000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9) = 0xb7373000
close(4) = 0
mprotect(0xb7373000, 4096, PROT_READ) = 0
munmap(0xb76ca000, 117803) = 0
open("/etc/host.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76e6000
read(4, "multi on\n", 1024) = 9
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb76e6000, 4096) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=295, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76e6000
read(4, "127.0.0.1 localhost.locald"..., 1024) = 295
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb76e6000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=117803, ...}) = 0
mmap2(NULL, 117803, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb76ca000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\f\0\0004\0\0\0"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0644, st_size=22088, ...}) = 0
mmap2(NULL, 20612, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb7363000
mmap2(0xb7367000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x4) = 0xb7367000
close(4) = 0
mprotect(0xb7367000, 4096, PROT_READ) = 0
munmap(0xb76ca000, 117803) = 0
stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
open("/etc/resolv.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76e6000
read(4, "# Dynamic resolv.conf(5) file fo"..., 4096) = 186
read(4, "", 4096) = 0
close(4) = 0
munmap(0xb76e6000, 4096) = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
gettimeofday({1366629539, 799916}, NULL) = 0
poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
send(4, "\t\370\1\0\0\1\0\0\0\0\0\0\6tjener\6intern\0\0\34\0\1", 31, MSG_NOSIGNAL) = 31
poll([{fd=4, events=POLLIN}], 1, 5000) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [72]) = 0
recvfrom(4, "\t\370\205\200\0\1\0\0\0\1\0\0\6tjener\6intern\0\0\34\0\1\300"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 72
close(4) = 0
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
gettimeofday({1366629539, 800807}, NULL) = 0
poll([{fd=4, events=POLLOUT}], 1, 0) = 1 ([{fd=4, revents=POLLOUT}])
send(4, "\301\4\1\0\0\1\0\0\0\0\0\0\6tjener\6intern\6inter"..., 38, MSG_NOSIGNAL) = 38
poll([{fd=4, events=POLLIN}], 1, 5000) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [86]) = 0
recvfrom(4, "\301\4\205\203\0\1\0\0\0\1\0\0\6tjener\6intern\6inter"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 86
close(4) = 0
write(2, "unknown host\n", 13unknown host
) = 13

Joachim Breitner

unread,
Apr 22, 2013, 7:40:01 AM4/22/13
to
Hi,

Am Montag, den 22.04.2013, 13:20 +0200 schrieb Petter Reinholdtsen:
> [Petter Reinholdtsen]
> > I do not know. ping6 is installed, but the command fail. This is
> > the output from ping6:
> >
> > root@tjener:~# ping6 fe80::5652:ff:fe1f:e659
> > connect: Invalid argument
> > root@tjener:~#
>
> Ah, wrong argument. I know why it fail now. check_ping uses NSS to
> look up the hostname, while ping6 uses DNS.
>
> root@tjener:~# ping6 tjener.intern
> unknown host
> root@tjener:~#
>
> And NSS and DNS do not agree in this case, causing ping6 to fail when
> called from check_ping.

would ping6 use data from /etc/hosts then? It seems to me that this is
more likely a bug in ping6 if it circumvents the system’s normal ways of
resolving names.

If you simply do not want to use ipv6, maybe it can be disabled system
wide, and maybe this would prevent libnss-myhostname from returning ipv6
names.
signature.asc

Petter Reinholdtsen

unread,
Apr 22, 2013, 9:10:02 AM4/22/13
to
[Joachim Breitner]
> would ping6 use data from /etc/hosts then? It seems to me that this
> is more likely a bug in ping6 if it circumvents the system???s
> normal ways of resolving names.

Hm, good point. Ah, right. I forgot I had removed libnss-myhostname
when I tested the second time. When I try again with
libnss-myhostname active, I get this result:

root@tjener:~# ping6 tjener.intern
connect: Invalid argument
root@tjener:~#

Strace below.

> If you simply do not want to use ipv6, maybe it can be disabled
> system wide, and maybe this would prevent libnss-myhostname from
> returning ipv6 names.

I guess we could, but we do not really want to active select to not
use IPv6, we just want to leave that part of the system untouched.


Here is the strace:

root@tjener:~# strace ping6 tjener.intern
execve("/bin/ping6", ["ping6", "tjener.intern"], [/* 23 vars */]) = 0
brk(0) = 0x891b000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7740000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=117917, ...}) = 0
mmap2(NULL, 117917, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7723000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P&\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=71488, ...}) = 0
mmap2(NULL, 79944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb770f000
mmap2(0xb771f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0xb771f000
mmap2(0xb7721000, 6216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7721000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\217\4\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1812104, ...}) = 0
mmap2(NULL, 1828080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7550000
mprotect(0xb76f3000, 4096, PROT_NONE) = 0
mmap2(0xb76f4000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb76f4000
mmap2(0xb770c000, 9456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb770c000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240o\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1437864, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb754f000
mmap2(NULL, 1452408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb73ec000
mprotect(0xb7548000, 4096, PROT_NONE) = 0
mmap2(0xb7549000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb7549000
mmap2(0xb754c000, 10616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb754c000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9844, ...}) = 0
mmap2(NULL, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb73e8000
mmap2(0xb73ea000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb73ea000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\33\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=95896, ...}) = 0
mmap2(NULL, 98556, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb73cf000
mmap2(0xb73e6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xb73e6000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb73ce000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb73ce8d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb73e6000, 4096, PROT_READ) = 0
mprotect(0xb73ea000, 4096, PROT_READ) = 0
mprotect(0xb7549000, 8192, PROT_READ) = 0
mprotect(0xb76f4000, 61440, PROT_READ) = 0
mprotect(0xb771f000, 4096, PROT_READ) = 0
mprotect(0xb775f000, 4096, PROT_READ) = 0
munmap(0xb7723000, 117917) = 0
socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6) = 3
getuid32() = 0
setuid32(0) = 0
socket(PF_NETLINK, SOCK_RAW, 0) = 4
bind(4, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(4, {sa_family=AF_NETLINK, pid=11436, groups=00000000}, [12]) = 0
time(NULL) = 1366635628
sendto(4, "\24\0\0\0\26\0\1\3l4uQ\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0l4uQ\254,\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 168
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0l4uQ\254,\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(4, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0l4uQ\254,\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(4) = 0
brk(0) = 0x891b000
brk(0x893c000) = 0x893c000
getpid() = 11436
open("/etc/resolv.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=186, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773f000
read(4, "# Dynamic resolv.conf(5) file fo"..., 4096) = 186
read(4, "", 4096) = 0
close(4) = 0
munmap(0xb773f000, 4096) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
close(4) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
close(4) = 0
open("/etc/nsswitch.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=703, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773f000
read(4, "# /etc/nsswitch.conf\n#\n# Example"..., 1024) = 703
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb773f000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=117917, ...}) = 0
mmap2(NULL, 117917, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7723000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/i686/cmov/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\32\0\0004\0\0\0"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0644, st_size=42628, ...}) = 0
mmap2(NULL, 45768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb73c2000
mmap2(0xb73cc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9) = 0xb73cc000
close(4) = 0
mprotect(0xb73cc000, 4096, PROT_READ) = 0
munmap(0xb7723000, 117917) = 0
open("/etc/host.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773f000
read(4, "multi on\n", 1024) = 9
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb773f000, 4096) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=295, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773f000
read(4, "127.0.0.1 localhost.locald"..., 1024) = 295
read(4, "", 1024) = 0
close(4) = 0
munmap(0xb773f000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=117917, ...}) = 0
mmap2(NULL, 117917, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7723000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libnss_myhostname.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\t\0\0004\0\0\0"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0644, st_size=9844, ...}) = 0
mmap2(NULL, 12700, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb73be000
mmap2(0xb73c1000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x2) = 0xb73c1000
close(4) = 0
munmap(0xb7723000, 117917) = 0
uname({sys="Linux", node="tjener.intern", ...}) = 0
socket(PF_NETLINK, SOCK_DGRAM, 0) = 4
setsockopt(4, SOL_SOCKET, SO_PASSCRED, [1], 4) = 0
send(4, "\21\0\0\0\26\0\5\3g\22\0\0\0\0\0\0\0", 17, 0) = 17
recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"0\0\0\0\24\0\2\0g\22\0\0\254,\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 16408}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=0, uid=0, gid=0}}, msg_flags=0}, 0) = 168
recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"@\0\0\0\24\0\2\0g\22\0\0\254,\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 16408}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=0, uid=0, gid=0}}, msg_flags=0}, 0) = 128
recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"\24\0\0\0\3\0\2\0g\22\0\0\254,\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 16408}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=0, uid=0, gid=0}}, msg_flags=0}, 0) = 20
close(4) = 0
socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET6, sin6_port=htons(1025), inet_pton(AF_INET6, "fe80::5652:ff:fe1f:e659", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EINVAL (Invalid argument)
dup(2) = 5
fcntl64(5, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(5, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb773f000
_llseek(5, 0, 0xbfddc878, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(5, "connect: Invalid argument\n", 26connect: Invalid argument
) = 26
close(5) = 0
munmap(0xb773f000, 4096) = 0

Petter Reinholdtsen

unread,
Apr 22, 2013, 9:40:02 AM4/22/13
to
[Petter Reinholdtsen]
> When I try again with libnss-myhostname active, I get this result:
>
> root@tjener:~# ping6 tjener.intern
> connect: Invalid argument
> root@tjener:~#
>
> Strace below.

I asked one of the local IPv6 experts, and he said ping6 is not
supposed to be able to ping the IPv6 Link address without specifying
the interface too:

root@tjener:~# getent hosts tjener.intern
fe80::5652:ff:fe1f:e659 tjener.intern
root@tjener:~# ping6 fe80::5652:ff:fe1f:e659
connect: Invalid argument
root@tjener:~# ping6 fe80::5652:ff:fe1f:e659%eth0
PING fe80::5652:ff:fe1f:e659%eth0(fe80::5652:ff:fe1f:e659) 56 data bytes
64 bytes from fe80::5652:ff:fe1f:e659: icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from fe80::5652:ff:fe1f:e659: icmp_seq=2 ttl=64 time=0.025 ms
64 bytes from fe80::5652:ff:fe1f:e659: icmp_seq=3 ttl=64 time=0.025 ms
^C
--- fe80::5652:ff:fe1f:e659%eth0 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.017/0.022/0.025/0.005 ms
root@tjener:~#

Notice the %eth0 part of the working address.

So if libnss-myhostname insist on returning the Link IPv6 address for
a given machine, it need to add the interface name as part of the
address string.

The reason the interface name is needed, is that the addresses are
only guaranteed to be unique per interface, and it is perfectly
possible to have the same IPv6 link address on several interfaces.

Please change libnss-myhostname to include the interface specifier for
all IPv6 Link addresses returned when looking up the local hostname.
Or just stop returning the IPv6 Link addresses.

Jan Wagner

unread,
Apr 22, 2013, 11:30:02 AM4/22/13
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cheers,

Am 22.04.13 15:27, schrieb Petter Reinholdtsen:
> So if libnss-myhostname insist on returning the Link IPv6 address
> for a given machine, it need to add the interface name as part of
> the address string.
>
> The reason the interface name is needed, is that the addresses are
> only guaranteed to be unique per interface, and it is perfectly
> possible to have the same IPv6 link address on several interfaces.

while this assumption is valid for local used (indeed with execptions)
and multicast IPv6 addresses, this should NOT be the case for globaly
routed IPv6 addresses.

Just my 2 euro-cents, Jan.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlF1VZIACgkQ9u6Dud+QFyQ7pQCbBSkoIJwipcUDfQ46J1T0TbOw
6EcAnjlF3YyRN5SdXM83GhpXto+SHsl1
=DQrp
-----END PGP SIGNATURE-----

Petter Reinholdtsen

unread,
Apr 22, 2013, 5:10:03 PM4/22/13
to
[Jan Wagner]
> while this assumption is valid for local used (indeed with
> execptions) and multicast IPv6 addresses, this should NOT be the
> case for globaly routed IPv6 addresses.

Sure. I only talk about the scope:Link addresses reported by
ifconfig. I was shown that on FreeBSD, ifconfig report these
addresses with the interface name appended, making sure the address
show by ifconfig actually work as is. Perhaps an idea for Linux too.

Anyway, Joachim, do you agree that the addresses returned by
libnss-myhostname when running 'getent hosts $(uname -n)' should be
pingable addresses? If so, I believe libnss-myhostname should be
changed. Besides, I suspect one would never put a IPv6 link scoped
address in /etc/hosts. :)

--
Happy hacking
Petter Reinholdtsen


Joachim Breitner

unread,
Apr 22, 2013, 5:20:01 PM4/22/13
to
Hi,

Am Montag, den 22.04.2013, 22:58 +0200 schrieb Petter Reinholdtsen:
> Anyway, Joachim, do you agree that the addresses returned by
> libnss-myhostname when running 'getent hosts $(uname -n)' should be
> pingable addresses? If so, I believe libnss-myhostname should be
> changed. Besides, I suspect one would never put a IPv6 link scoped
> address in /etc/hosts. :)

I agree that the address should be pingable, I just wanted to understand
the problem better before I forward it upstream:

Dear Lennart,

it was reported that libnss-myhostname may report an IPv6 address for
the local hostname that is not pingable, as it is a link scoped address,
and it was suggested that it not do that. Do you agree and can you fix
it?

Thanks a lot,
signature.asc

Petter Reinholdtsen

unread,
Apr 27, 2013, 3:50:02 AM4/27/13
to
[Joachim Breitner]
> it was reported that libnss-myhostname may report an IPv6 address
> for the local hostname that is not pingable, as it is a link scoped
> address, and it was suggested that it not do that. Do you agree and
> can you fix it?

Here is a simple patch to make sure link local addresses are no longer
returned by libnss-myhostname.

The alternative would be to return addresses with %interface appended,
but I did not investigate how to do that.

The attached and tested patch solve my problem, making the command
'ping6 $(hostname)' work again. I choose to work on the string
representation of the address, to avoid having to add endian specific
code to look in the "raw" address. Perhaps there is a better and
still portable way to do this?
nss-myhostname-ignore-ipv6-linkaddr.diff

Joachim Breitner

unread,
Apr 27, 2013, 1:10:02 PM4/27/13
to
Hi,
thanks for the patch. However, I’m reluctant to apply it without
upstream’s opinion and blessing. Lennart, can you comment on the problem
and solution?

Thanks,
signature.asc

Petter Reinholdtsen

unread,
Apr 28, 2013, 5:40:02 PM4/28/13
to

[Joachim Breitner]
> thanks for the patch. However, I’m reluctant to apply it without
> upstream’s opinion and blessing. Lennart, can you comment on the
> problem and solution?

I understand perfectly. We are also reluctant to make our own
libnss-myhostname packages in Debian Edu before we know which way the
official package will be heading, so it would be great with some
feedback soon.

Our preferred solution would be a new upstream release addressing this
issue that we could backport and put in our own APT repository. A
useful alternative would be Debian specific patches in unstable - we
would backport this too. The least attractive alternative is for us to
put our own patched package in our APT repository without knowing if our
approach is the one that will be implemented upstream or in the
"official" Debian package.

--
Happy hacking
Petter Reinholdtsen


Petter Reinholdtsen

unread,
May 2, 2013, 8:30:02 AM5/2/13
to
Hi, Joachim.

Would you be willing to provide a fix for this in a Wheezy update?
Knowing the answer to this question would make it easier for us in
Debian Edu to plan what to do.

Joachim Breitner

unread,
May 2, 2013, 8:40:02 AM5/2/13
to
Hi,

Am Donnerstag, den 02.05.2013, 14:25 +0200 schrieb Petter Reinholdtsen:
> Would you be willing to provide a fix for this in a Wheezy update?
> Knowing the answer to this question would make it easier for us in
> Debian Edu to plan what to do.

I’d be willing to package a fix; I’m still reluctant to provide the fix
myself.

Maybe Phil Kern (one of the ipv6 experts I know and who showed knowledge
of nss and ipv6 at http://bugs.debian.org/575781) can comment on your
patch?

Greetings,
signature.asc

Lennart Poettering

unread,
May 3, 2013, 7:40:03 AM5/3/13
to
On Sat, 27.04.13 09:39, Petter Reinholdtsen (pe...@hungry.com) wrote:

> [Joachim Breitner]
> > it was reported that libnss-myhostname may report an IPv6 address
> > for the local hostname that is not pingable, as it is a link scoped
> > address, and it was suggested that it not do that. Do you agree and
> > can you fix it?
>
> Here is a simple patch to make sure link local addresses are no longer
> returned by libnss-myhostname.

We currently filter addresses of HOST and NOWHERE scope, but local
addresses should generally be fine.

> The alternative would be to return addresses with %interface appended,
> but I did not investigate how to do that.

This is done by filling in the scopeid field, which we do.

See

http://cgit.freedesktop.org/systemd/systemd/tree/src/nss-myhostname/nss-myhostname.c#n180

> +bool is_ipv6_link_local(unsigned short family, void *address) {
> + char str_buffer[INET6_ADDRSTRLEN];
> + if (AF_INET6 != family)
> + return false;

Yoda style comparisons are not acceptable in systemd's sources.

> +
> + if (NULL == inet_ntop(AF_INET6, address, str_buffer, INET6_ADDRSTRLEN))
> + return false;
> +
> + if (0 == strncmp("fe", str_buffer, 2)) {
> + char c = str_buffer[2];
> + if (c == '8' || c == '9' || c == 'a' || c == 'b')
> + return true;
> + }
> + return false;

If you want to filtzer local scoped addresses, then use the scope field
supplied by the kernel, nothing else. You shouldn't duplicate the scope
logic of the kernel by looking at the addersses themsleves...

But anyway, AFAICS we already do the right thing here anyway, and local
addresses should be unproblematic.

Lennart

--
Lennart Poettering - Red Hat, Inc.

Joachim Breitner

unread,
May 5, 2013, 9:10:02 AM5/5/13
to
Control: reassign -1 iputils
Control: retitle -1 ping6 should respect the scope_id returned by getaddrinfo

Hi everyone,

Am Freitag, den 03.05.2013, 13:22 +0200 schrieb Lennart Poettering:
> We currently filter addresses of HOST and NOWHERE scope, but local
> addresses should generally be fine.
>
> > The alternative would be to return addresses with %interface appended,
> > but I did not investigate how to do that.
>
> This is done by filling in the scopeid field, which we do.
>
>[..]
>
> But anyway, AFAICS we already do the right thing here anyway, and local
> addresses should be unproblematic.

from this I wondered if ping6 is the problem, but it seem to look good
(despite a possibly related bug at
https://bugzilla.redhat.com/show_bug.cgi?id=505044).

But it seems that the scope id is not really passed all the way down to
the user. Using the attached test code, I get:
$ ./test kirk
Scope id returned for ./test: 0

So is this a bug in the libc?

Greetings,
test.c
signature.asc

Petter Reinholdtsen

unread,
May 5, 2013, 2:10:01 PM5/5/13
to

[Joachim Breitner]
> But it seems that the scope id is not really passed all the way down to
> the user. Using the attached test code, I get:
> $ ./test kirk
> Scope id returned for ./test: 0
>
> So is this a bug in the libc?

Could be. What do you believe 'getent hosts $(hostname)' should print
if glibc did the right thing? Should the following work on a machine
with link local IPv6 addresses?

ping6 $(getent hosts $(hostname)|awk '{print $1}')

This fail when libnss-myhostname is enabled. It work without
libnss-myhostname enabled, because getent return ::1.

--
Happy hacking
Petter Reinholdtsen


Noah Meyerhans

unread,
May 5, 2013, 8:20:02 PM5/5/13
to
On Sun, May 05, 2013 at 07:59:02PM +0200, Petter Reinholdtsen wrote:
>
> [Joachim Breitner]
> > But it seems that the scope id is not really passed all the way down to
> > the user. Using the attached test code, I get:
> > $ ./test kirk
> > Scope id returned for ./test: 0
> >
> > So is this a bug in the libc?
>
> Could be. What do you believe 'getent hosts $(hostname)' should print
> if glibc did the right thing? Should the following work on a machine
> with link local IPv6 addresses?
>
> ping6 $(getent hosts $(hostname)|awk '{print $1}')
>
> This fail when libnss-myhostname is enabled. It work without
> libnss-myhostname enabled, because getent return ::1.

This doesn't sound like a bug in libc or in ping6. getaddrinfo() will
return a scope ID if you've explicitly provided one in the hints you've
provided. For example, notice the different behavior when running
Joachim's test.c program with a scoped address as opposed to a
non-scoped address (e.g. fe80::21f:3bff:fe26:abcd%eth0 vs
fe80::21f:3bff:fe26:abcd). getaddrinfo() has no way of knowing that the
input address is related in any way to a particular interface, so it
isn't going to assume that it's a link-local scope (or any other scope)
of address, and is going to leave sin6_scope_id undefined. If you
specify a link ID, then it knows to treat the address as link-local.

libnss-myhostname is, IMO, doing the wrong thing by returning link-local
addresses. All the other addresses that it returns, including the
fallback ::1 or 127.0.1.1, are routable from localhost. Link-local
addresses by themselves are not, and more closely resemble MAC addresses
than any sort of address you'll run a server on.

Or, to put this another way (referring to the original use case that
lead to this ticket), if you want to use a nagios check to see if your
server is reachable, the link-local address is not what you want. Your
server will not be listening on link-local addresses, your clients won't
use their link-local addresses when communicating with the server, and
even if they they wanted to, they would then have to start worrying
about interface IDs and address scopes themselves.

The fact that "ping6 $(getent hosts $(hostname)|awk '{print $1}')"
breaks when libnss-myhostname is installed further suggests that it's
doign something wrong.

libnss-myhostname should either filter link-local address itself, or
provide a mechanism for clients to do so.

noah

Petter Reinholdtsen

unread,
May 7, 2013, 10:30:05 AM5/7/13
to
[Noah Meyerhans]
> This doesn't sound like a bug in libc or in ping6. getaddrinfo() will
> return a scope ID if you've explicitly provided one in the hints you've
> provided. For example, notice the different behavior when running
> Joachim's test.c program with a scoped address as opposed to a
> non-scoped address (e.g. fe80::21f:3bff:fe26:abcd%eth0 vs
> fe80::21f:3bff:fe26:abcd). getaddrinfo() has no way of knowing that the
> input address is related in any way to a particular interface, so it
> isn't going to assume that it's a link-local scope (or any other scope)
> of address, and is going to leave sin6_scope_id undefined. If you
> specify a link ID, then it knows to treat the address as link-local.

I do not know IPv6 addressing or the glibc internals well enough to
form an opinion on this, but I do not understand your argument. ping6
and libc can know from the values in the IPv6 address if it is a
link-local address or not, and if it is a link-local address, it need
the scope. Why isn't that enough to implement handling of this issue
in ping6 and libc?

Using that information, ping6 can know that fe80::21f:3bff:fe26:abcd
is not going to work, while fe80::21f:3bff:fe26:abcd%eth0 have a fair
chance of working. Why can't getaddrinfo()?

> The fact that "ping6 $(getent hosts $(hostname)|awk '{print $1}')"
> breaks when libnss-myhostname is installed further suggests that
> it's doign something wrong.

Or perhaps libc is doing something wrong. I noticed on FreeBSD,
ifconfig returned addresses with the %if ending for link local
addresses, while on linux ifconfig do not. This seem like a bug or
misfeature on Linux to me, that the addresses shown by ifconfig can
not be pinged. Perhaps it is caused by some underlying problem in
libc, also affecting ping6?

--
Happy hacking
Petter Reinholdtsen


Noah Meyerhans

unread,
May 7, 2013, 12:50:02 PM5/7/13
to
On Tue, May 07, 2013 at 04:25:40PM +0200, Petter Reinholdtsen wrote:
> I do not know IPv6 addressing or the glibc internals well enough to
> form an opinion on this, but I do not understand your argument. ping6
> and libc can know from the values in the IPv6 address if it is a
> link-local address or not, and if it is a link-local address, it need
> the scope. Why isn't that enough to implement handling of this issue
> in ping6 and libc?

Because unless you explicitly specify a scope ID, the kernel and libc
cannot infer them. This is why you need to specify the scope ID when
pinging a link-local address.

> Using that information, ping6 can know that fe80::21f:3bff:fe26:abcd
> is not going to work, while fe80::21f:3bff:fe26:abcd%eth0 have a fair
> chance of working. Why can't getaddrinfo()?

What should getaddrinfo know? The scope ID is the interface identifier.
getaddrinfo() can't infer what interface you want the address scoped to.
You may not be asking about a local interface, or you may have the same
link-local address on multiple interfaces.

> > The fact that "ping6 $(getent hosts $(hostname)|awk '{print $1}')"
> > breaks when libnss-myhostname is installed further suggests that
> > it's doign something wrong.
>
> Or perhaps libc is doing something wrong. I noticed on FreeBSD,
> ifconfig returned addresses with the %if ending for link local
> addresses, while on linux ifconfig do not. This seem like a bug or
> misfeature on Linux to me, that the addresses shown by ifconfig can
> not be pinged. Perhaps it is caused by some underlying problem in
> libc, also affecting ping6?

No. ifconfig on freebsd is being helpful by appending the scope ID to
the link-local address when it presents it to you, but that doesn't in
any way imply that the Linux ifconfig is buggy for not doing this. The
scope-ID is returned to you in the Linux ifconfig output: It is the
interface name.

Keep in mind, though, that the scope ID is only meaningful on the local
host, because that's the only place where that interface configuration
is present. E.g. I've got a host here that has link-local address
fe80::224:8cff:fe66:7a3. If I want to ping that link-local address from
my laptop, via the laptop's wifi interface, I need to specify the
address and scope ID as fe80::224:8cff:fe66:7a3%wlan0. However, on the
host with that address, the scoped address would be
fe80::224:8cff:fe66:7a3%eth0. If I log in to my router and want to ping
that address, I need to scope it with fe80::224:8cff:fe66:7a3%br-lan.
Scope ID is purely a local thing, and is not going to be meaningful
anywhere else on the network, except coincidentally.

noah

signature.asc

Lennart Poettering

unread,
May 7, 2013, 1:00:01 PM5/7/13
to
On Tue, 07.05.13 12:43, Noah Meyerhans (no...@debian.org) wrote:

> On Tue, May 07, 2013 at 04:25:40PM +0200, Petter Reinholdtsen wrote:
> > I do not know IPv6 addressing or the glibc internals well enough to
> > form an opinion on this, but I do not understand your argument. ping6
> > and libc can know from the values in the IPv6 address if it is a
> > link-local address or not, and if it is a link-local address, it need
> > the scope. Why isn't that enough to implement handling of this issue
> > in ping6 and libc?
>
> Because unless you explicitly specify a scope ID, the kernel and libc
> cannot infer them. This is why you need to specify the scope ID when
> pinging a link-local address.

As mentioned, nss-myhostname provides the scope ID field filled in
correctly to glibc. If this information is somehow lost on the way to
the caller of getaddrinfo(), then this is a fuckup in glibc, and that's
it.

Lennart

--
Lennart Poettering - Red Hat, Inc.


Noah Meyerhans

unread,
May 7, 2013, 6:00:01 PM5/7/13
to
On Tue, May 07, 2013 at 06:52:36PM +0200, Lennart Poettering wrote:
> As mentioned, nss-myhostname provides the scope ID field filled in
> correctly to glibc. If this information is somehow lost on the way to
> the caller of getaddrinfo(), then this is a fuckup in glibc, and that's
> it.

Possibly, but I can't find any documentation, either internal to glibc
or from the IETF, suggesting that getaddrinfo() is expected to return a
non-default (i.e. non-zero) scope ID unless one was explicitly specified
by the caller. I also note that FreeBSD's getaddrinfo() behaves the
same as glibc's, in that the scope ID is set to 0 except in the specific
case where the caller passed a scoped numeric address as the first
argument.

Sections 2.1 and 2.2 of draft-ietf-ipv6-scope-api-00 ("Scoped Address
Extensions to the IPv6 Basic Socket API") are relevant here, as they
define the updates to getaddrinfo() for scoped addresses.

I'm going to re-assign this to the glibc maintainers for their comment,
but again, I don't think glibc is doing anything wrong.

noah

signature.asc

Petter Reinholdtsen

unread,
May 12, 2013, 2:10:01 AM5/12/13
to
So, to summarize:

1) 'check_ping $(hostname)' in Nagios fail when libnss-myhostname is
active, because glibc return the IPv6 link local address when
looking up the IP address of the local host.
2) ping6 can not ping the IPv6 link local address without an network
interface specifier. The same happen with any IPv6 capable
program.
3) I've provided a patch for libnss-myhostname to not return IPv6
link local addresses.
4) Upstream believe the patch should not be used, and claim
libnss-myhostname is doing everything correct and the bug is in
glibc and/or ping6.
5) The ping6 maintainer claim there is no bug in ping6 and glibc, as
their handling of addresses in getaddrinfo() is according to the
specification and work the same on Linux and FreeBSD.

And thus we are left with a libnss-myhostname package that break any
IPv6 capable program trying to connect to the local host name.

Joachim, perhaps time to use the patch I provided in the Debian
package, while we wait for these lofty old wizards to fight out their
world view dispute?

I fail to see the advantage of having libnss-myhostname, which is
intended to make sure it is possible to look up the local host name
and always get a working IP address, return an IPv6 address that can't
be used to ping, connect or pass on.

--
Happy hacking
Petter Reinholdtsen


Joachim Breitner

unread,
May 13, 2013, 4:10:02 AM5/13/13
to
Hi,

I got more information: If, in the attached example test.c, the
ai_family field of the hints argument to getaddrinfo is set to
"AF_UNSPEC", then I do get the correct scope id in the returned data
structure.

If the hint is set to AF_INET6, I don’t (but I also do not get the
debugging information that I put into libnss-myhostname, so I might just
not fully understand what’s going on here).
test.c
signature.asc

Joachim Breitner

unread,
May 13, 2013, 4:50:02 AM5/13/13
to
Hi Petter,

Am Sonntag, den 12.05.2013, 08:02 +0200 schrieb Petter Reinholdtsen:
> Joachim, perhaps time to use the patch I provided in the Debian
> package, while we wait for these lofty old wizards to fight out their
> world view dispute?

I modified it to use a libc-provided macro to detect
link-local-addresses. It works here, but would you mind testing it in
your setup:
http://git.nomeata.de/?p=libnss-myhostname.git;a=summary
signature.asc

Lennart Poettering

unread,
May 13, 2013, 9:40:03 AM5/13/13
to
On Sun, 12.05.13 08:02, Petter Reinholdtsen (pe...@hungry.com) wrote:

> Joachim, perhaps time to use the patch I provided in the Debian
> package, while we wait for these lofty old wizards to fight out their
> world view dispute?

How about just spending some time to track down the *actual* issue and
then doing something? It shouldn't be too hard to figure out where the
scopeid is lost between nss-myhostname and ping6 on Debian?

It's usually a good idea to first understand the whole issue and then
fixing it at the right place before prematurely applying knowingly
incorrect patches that just tape over things?

> I fail to see the advantage of having libnss-myhostname, which is
> intended to make sure it is possible to look up the local host name
> and always get a working IP address, return an IPv6 address that can't
> be used to ping, connect or pass on.

Thanks for being so constructive.

Lennart

--
Lennart Poettering - Red Hat, Inc.


Lennart Poettering

unread,
May 13, 2013, 9:50:02 AM5/13/13
to
On Mon, 13.05.13 10:03, Joachim Breitner (nom...@debian.org) wrote:

> Hi,
>
> I got more information: If, in the attached example test.c, the
> ai_family field of the hints argument to getaddrinfo is set to
> "AF_UNSPEC", then I do get the correct scope id in the returned data
> structure.
>
> If the hint is set to AF_INET6, I don’t (but I also do not get the
> debugging information that I put into libnss-myhostname, so I might just
> not fully understand what’s going on here).

BTW, you are aware of "getent ahosts" and "getent ahostsv6" which pretty
much do what your test tool does?

Joachim Breitner

unread,
May 13, 2013, 9:50:03 AM5/13/13
to
Hi,

Am Montag, den 13.05.2013, 15:40 +0200 schrieb Lennart Poettering:
> On Mon, 13.05.13 10:03, Joachim Breitner (nom...@debian.org) wrote:
> > I got more information: If, in the attached example test.c, the
> > ai_family field of the hints argument to getaddrinfo is set to
> > "AF_UNSPEC", then I do get the correct scope id in the returned data
> > structure.
> >
> > If the hint is set to AF_INET6, I don’t (but I also do not get the
> > debugging information that I put into libnss-myhostname, so I might just
> > not fully understand what’s going on here).
>
> BTW, you are aware of "getent ahosts" and "getent ahostsv6" which pretty
> much do what your test tool does?

I am aware of them, but I was not sure how, if at all, that would print
scope ids, and wanted to reduce the possible points where the
information might be lost.

BTW, were you able to reproduce the problem on your system?
signature.asc

Petter Reinholdtsen

unread,
May 13, 2013, 7:20:02 PM5/13/13
to
[Joachim Breitner]
> I modified it to use a libc-provided macro to detect
> link-local-addresses. It works here, but would you mind testing it in
> your setup:
> http://git.nomeata.de/?p=libnss-myhostname.git;a=summary

It seem to work just fine when I test it too. :)

I hope the fix will make it into Wheezy soon. :)

Joachim Breitner

unread,
May 21, 2013, 10:00:02 AM5/21/13
to
Hi,

Am Dienstag, den 14.05.2013, 01:14 +0200 schrieb Petter Reinholdtsen:
> [Joachim Breitner]
> > I modified it to use a libc-provided macro to detect
> > link-local-addresses. It works here, but would you mind testing it in
> > your setup:
> > http://git.nomeata.de/?p=libnss-myhostname.git;a=summary
>
> It seem to work just fine when I test it too. :)
>
> I hope the fix will make it into Wheezy soon. :)

just uploaded to unstable. I have never done a stable update, but I
guess I’ll have to wait for it to enter jessie (i.e. wait 10 days), and
then talk to the release team.
signature.asc

Petter Reinholdtsen

unread,
May 21, 2013, 2:20:02 PM5/21/13
to
reassign 705900 libnss-myhostname
thanks

[Joachim Breitner]
> just uploaded to unstable. I have never done a stable update, but I
> guess I’ll have to wait for it to enter jessie (i.e. wait 10 days),
> and then talk to the release team.

Actually, I believe the correct approach is to file a pu reqest right
now like the one I got in #706762, and use it to coordinate the upload
to stable. I have not done it myself for a long time, so I am not
quite sure, but one of the release managers said it was the correct
first step.

Joachim Breitner

unread,
May 22, 2013, 7:10:02 AM5/22/13
to
Hi,

Am Dienstag, den 21.05.2013, 20:17 +0200 schrieb Petter Reinholdtsen:
> [Joachim Breitner]
> > just uploaded to unstable. I have never done a stable update, but I
> > guess I’ll have to wait for it to enter jessie (i.e. wait 10 days),
> > and then talk to the release team.
>
> Actually, I believe the correct approach is to file a pu reqest right
> now like the one I got in #706762, and use it to coordinate the upload
> to stable. I have not done it myself for a long time, so I am not
> quite sure, but one of the release managers said it was the correct
> first step.

filed as http://bugs.debian.org/709286
signature.asc
0 new messages