Debian Bug report logs - #705900
Do not return link-local addresses

version graph

Package: libnss-myhostname; Maintainer for libnss-myhostname is Joachim Breitner <nomeata@debian.org>; Source for libnss-myhostname is src:libnss-myhostname.

Reported by: Petter Reinholdtsen <pere@hungry.com>

Date: Sun, 21 Apr 2013 22:27:02 UTC

Severity: important

Tags: patch

Fixed in versions libnss-myhostname/0.3-5, libnss-myhostname/0.3-5~deb7u1

Done: Joachim Breitner <nomeata@debian.org>

Bug is archived. No further changes may be made.

Forwarded to Lennart Poettering <lennart@poettering.net>

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, debian-edu@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Sun, 21 Apr 2013 22:27:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
New Bug report received and forwarded. Copy sent to debian-edu@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Sun, 21 Apr 2013 22:27:06 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: submit@bugs.debian.org
Subject: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 00:22:47 +0200
Package:  nagios-plugins-basic
Version:  1.4.16-1
Severity: important
User:     debian-edu@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



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Mon, 22 Apr 2013 07:09:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Wagner <waja@cyconet.org>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Mon, 22 Apr 2013 07:09:09 GMT) Full text and rfc822 format available.

Message #10 received at 705900@bugs.debian.org (full text, mbox):

From: Jan Wagner <waja@cyconet.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: [Pkg-nagios-devel] Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 09:05:44 +0200
-----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 <waja@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-----



Added tag(s) unreproducible and moreinfo. Request was from Jan Wagner <waja@cyconet.org> to control@bugs.debian.org. (Mon, 22 Apr 2013 07:09:12 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Mon, 22 Apr 2013 07:24:13 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Mon, 22 Apr 2013 07:24:13 GMT) Full text and rfc822 format available.

Message #17 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Subject: Re: [Pkg-nagios-devel] Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 09:23:14 +0200
[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



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Mon, 22 Apr 2013 07:39:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Wagner <waja@cyconet.org>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Mon, 22 Apr 2013 07:39:04 GMT) Full text and rfc822 format available.

Message #22 received at 705900@bugs.debian.org (full text, mbox):

From: Jan Wagner <waja@cyconet.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Subject: Re: [Pkg-nagios-devel] Bug#705900: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 09:37:01 +0200
-----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 <waja@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-----



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Mon, 22 Apr 2013 08:36:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Mon, 22 Apr 2013 08:36:04 GMT) Full text and rfc822 format available.

Message #27 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Subject: Re: [Pkg-nagios-devel] Bug#705900: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 10:32:29 +0200
[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



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Mon, 22 Apr 2013 09:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Wagner <waja@cyconet.org>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Mon, 22 Apr 2013 09:30:04 GMT) Full text and rfc822 format available.

Message #32 received at 705900@bugs.debian.org (full text, mbox):

From: Jan Wagner <waja@cyconet.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: [Pkg-nagios-devel] Bug#705900: Bug#705900: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 11:26:58 +0200
-----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 <waja@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-----



Severity set to 'minor' from 'important' Request was from Jan Wagner <waja@cyconet.org> to control@bugs.debian.org. (Mon, 22 Apr 2013 09:30:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#705900; Package nagios-plugins-basic. (Mon, 22 Apr 2013 09:57:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>. (Mon, 22 Apr 2013 09:57:07 GMT) Full text and rfc822 format available.

Message #39 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 11:55:51 +0200
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



Bug reassigned from package 'nagios-plugins-basic' to 'libnss-myhostname'. Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Mon, 22 Apr 2013 09:57:10 GMT) Full text and rfc822 format available.

No longer marked as found in versions nagios-plugins/1.4.16-1. Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Mon, 22 Apr 2013 09:57:11 GMT) Full text and rfc822 format available.

Marked as found in versions libnss-myhostname/0.3-4. Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Mon, 22 Apr 2013 09:57:12 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'minor' Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Mon, 22 Apr 2013 09:57:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 10:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Mon, 22 Apr 2013 10:57:04 GMT) Full text and rfc822 format available.

Message #52 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: 705900@bugs.debian.org
Cc: Petter Reinholdtsen <pere@hungry.com>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 12:52:20 +0200
[Message part 1 (text/plain, inline)]
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
  nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 11:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Mon, 22 Apr 2013 11:03:04 GMT) Full text and rfc822 format available.

Message #57 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Cc: Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 13:00:29 +0200
[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:~#

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 11:24:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Mon, 22 Apr 2013 11:24:08 GMT) Full text and rfc822 format available.

Message #62 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 13:20:18 +0200
[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
exit_group(2)                           = ?
root@tjener:~#



-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 11:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Mon, 22 Apr 2013 11:30:04 GMT) Full text and rfc822 format available.

Message #67 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 13:28:10 +0200
[Message part 1 (text/plain, inline)]
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.


Greetings,
Joachim


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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 13:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Mon, 22 Apr 2013 13:06:04 GMT) Full text and rfc822 format available.

Message #72 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 15:04:39 +0200
[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
exit_group(2)                           = ?
root@tjener:~#

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 13:30:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Mon, 22 Apr 2013 13:30:09 GMT) Full text and rfc822 format available.

Message #77 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 15:27:04 +0200
[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.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 15:24:15 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Wagner <waja@cyconet.org>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Mon, 22 Apr 2013 15:24:15 GMT) Full text and rfc822 format available.

Message #82 received at 705900@bugs.debian.org (full text, mbox):

From: Jan Wagner <waja@cyconet.org>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: 705900@bugs.debian.org
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 17:21:55 +0200
-----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-----



Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 21:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Mon, 22 Apr 2013 21:03:04 GMT) Full text and rfc822 format available.

Message #87 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Cc: Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 22:58:03 +0200
[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



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Mon, 22 Apr 2013 21:15:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Mon, 22 Apr 2013 21:15:07 GMT) Full text and rfc822 format available.

Message #92 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Lennart Poettering <lennart@poettering.net>
Cc: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 22 Apr 2013 23:10:52 +0200
[Message part 1 (text/plain, inline)]
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,
Joachim


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

[signature.asc (application/pgp-signature, inline)]

Set Bug forwarded-to-address to 'Lennart Poettering <lennart@poettering.net>'. Request was from Joachim Breitner <nomeata@debian.org> to control@bugs.debian.org. (Mon, 22 Apr 2013 21:15:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Sat, 27 Apr 2013 07:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Sat, 27 Apr 2013 07:42:04 GMT) Full text and rfc822 format available.

Message #99 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Cc: Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sat, 27 Apr 2013 09:39:22 +0200
[Message part 1 (text/plain, inline)]
[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?

-- 
Happy hacking
Petter Reinholdtsen
[nss-myhostname-ignore-ipv6-linkaddr.diff (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Sat, 27 Apr 2013 17:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Sat, 27 Apr 2013 17:00:05 GMT) Full text and rfc822 format available.

Message #104 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sat, 27 Apr 2013 18:55:14 +0200
[Message part 1 (text/plain, inline)]
Hi,

Am Samstag, den 27.04.2013, 09:39 +0200 schrieb Petter Reinholdtsen:
> [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?

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,
Joachim


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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Sun, 28 Apr 2013 21:30:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Sun, 28 Apr 2013 21:30:09 GMT) Full text and rfc822 format available.

Message #109 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Joachim Breitner <nomeata@debian.org>, 705900@bugs.debian.org
Cc: Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sun, 28 Apr 2013 23:27:14 +0200
[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



Removed tag(s) unreproducible and moreinfo. Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Thu, 02 May 2013 10:06:14 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Thu, 02 May 2013 10:06:15 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Thu, 02 May 2013 12:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Thu, 02 May 2013 12:27:03 GMT) Full text and rfc822 format available.

Message #118 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Joachim Breitner <nomeata@debian.org>
Cc: 705900@bugs.debian.org, Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Thu, 2 May 2013 14:25:47 +0200
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.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Thu, 02 May 2013 12:39:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Thu, 02 May 2013 12:39:07 GMT) Full text and rfc822 format available.

Message #123 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>, Philipp kern <pkern@debian.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Thu, 02 May 2013 14:34:43 +0200
[Message part 1 (text/plain, inline)]
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,
Joachim


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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joachim Breitner <nomeata@debian.org>:
Bug#705900; Package libnss-myhostname. (Fri, 03 May 2013 11:33:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Poettering <lennart@poettering.net>:
Extra info received and forwarded to list. Copy sent to Joachim Breitner <nomeata@debian.org>. (Fri, 03 May 2013 11:33:11 GMT) Full text and rfc822 format available.

Message #128 received at 705900@bugs.debian.org (full text, mbox):

From: Lennart Poettering <lennart@poettering.net>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Fri, 3 May 2013 13:22:51 +0200
On Sat, 27.04.13 09:39, Petter Reinholdtsen (pere@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.



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Sun, 05 May 2013 13:03:12 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Sun, 05 May 2013 13:03:12 GMT) Full text and rfc822 format available.

Message #133 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Lennart Poettering <lennart@poettering.net>, 705900@bugs.debian.org
Cc: Petter Reinholdtsen <pere@hungry.com>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sun, 05 May 2013 15:00:35 +0200
[Message part 1 (text/plain, inline)]
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,
Joachim

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

[test.c (text/x-csrc, attachment)]
[signature.asc (application/pgp-signature, inline)]

Bug reassigned from package 'libnss-myhostname' to 'iputils'. Request was from Joachim Breitner <nomeata@debian.org> to 705900-submit@bugs.debian.org. (Sun, 05 May 2013 13:03:12 GMT) Full text and rfc822 format available.

No longer marked as found in versions libnss-myhostname/0.3-4. Request was from Joachim Breitner <nomeata@debian.org> to 705900-submit@bugs.debian.org. (Sun, 05 May 2013 13:03:13 GMT) Full text and rfc822 format available.

Changed Bug title to 'ping6 should respect the scope_id returned by getaddrinfo' from 'check_ping fail if host do not have IPv6 address' Request was from Joachim Breitner <nomeata@debian.org> to 705900-submit@bugs.debian.org. (Sun, 05 May 2013 13:03:14 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Noah Meyerhans <noahm@debian.org>:
Bug#705900; Package iputils. (Sun, 05 May 2013 18:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Noah Meyerhans <noahm@debian.org>. (Sun, 05 May 2013 18:03:04 GMT) Full text and rfc822 format available.

Message #144 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Joachim Breitner <nomeata@debian.org>, Lennart Poettering <lennart@poettering.net>, 705900@bugs.debian.org
Cc: Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sun, 05 May 2013 19:59:02 +0200
[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



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package iputils. (Mon, 06 May 2013 00:18:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noah Meyerhans <noahm@debian.org>:
Extra info received and forwarded to list. (Mon, 06 May 2013 00:18:04 GMT) Full text and rfc822 format available.

Message #149 received at 705900@bugs.debian.org (full text, mbox):

From: Noah Meyerhans <noahm@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: Joachim Breitner <nomeata@debian.org>, Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sun, 5 May 2013 19:40:23 -0400
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




Information forwarded to debian-bugs-dist@lists.debian.org, Noah Meyerhans <noahm@debian.org>:
Bug#705900; Package iputils. (Tue, 07 May 2013 14:27:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Noah Meyerhans <noahm@debian.org>. (Tue, 07 May 2013 14:27:04 GMT) Full text and rfc822 format available.

Message #154 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Noah Meyerhans <noahm@debian.org>
Cc: 705900@bugs.debian.org, Joachim Breitner <nomeata@debian.org>, Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 7 May 2013 16:25:40 +0200
[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



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package iputils. (Tue, 07 May 2013 16:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noah Meyerhans <noahm@debian.org>:
Extra info received and forwarded to list. (Tue, 07 May 2013 16:45:04 GMT) Full text and rfc822 format available.

Message #159 received at 705900@bugs.debian.org (full text, mbox):

From: Noah Meyerhans <noahm@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org
Cc: Joachim Breitner <nomeata@debian.org>, Lennart Poettering <lennart@poettering.net>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 7 May 2013 12:43:53 -0400
[Message part 1 (text/plain, inline)]
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 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Noah Meyerhans <noahm@debian.org>:
Bug#705900; Package iputils. (Tue, 07 May 2013 16:57:14 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Poettering <lennart@poettering.net>:
Extra info received and forwarded to list. Copy sent to Noah Meyerhans <noahm@debian.org>. (Tue, 07 May 2013 16:57:14 GMT) Full text and rfc822 format available.

Message #164 received at 705900@bugs.debian.org (full text, mbox):

From: Lennart Poettering <lennart@poettering.net>
To: Noah Meyerhans <noahm@debian.org>
Cc: Petter Reinholdtsen <pere@hungry.com>, 705900@bugs.debian.org, Joachim Breitner <nomeata@debian.org>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 7 May 2013 18:52:36 +0200
On Tue, 07.05.13 12:43, Noah Meyerhans (noahm@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.



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package iputils. (Tue, 07 May 2013 21:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noah Meyerhans <noahm@debian.org>:
Extra info received and forwarded to list. (Tue, 07 May 2013 21:51:04 GMT) Full text and rfc822 format available.

Message #169 received at 705900@bugs.debian.org (full text, mbox):

From: Noah Meyerhans <noahm@debian.org>
To: Lennart Poettering <lennart@poettering.net>, 705900@bugs.debian.org
Cc: Petter Reinholdtsen <pere@hungry.com>, Joachim Breitner <nomeata@debian.org>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 7 May 2013 17:48:26 -0400
[Message part 1 (text/plain, inline)]
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 (application/pgp-signature, inline)]

Bug reassigned from package 'iputils' to 'libc6'. Request was from Noah Meyerhans <noahm@debian.org> to control@bugs.debian.org. (Tue, 07 May 2013 22:18:07 GMT) Full text and rfc822 format available.

Changed Bug title to 'getaddrinfo() should set sin6_scope_id' from 'ping6 should respect the scope_id returned by getaddrinfo' Request was from Noah Meyerhans <noahm@debian.org> to control@bugs.debian.org. (Tue, 07 May 2013 22:18:08 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Sun, 12 May 2013 06:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Sun, 12 May 2013 06:06:04 GMT) Full text and rfc822 format available.

Message #178 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Joachim Breitner <nomeata@debian.org>, Noah Meyerhans <noahm@debian.org>, Lennart Poettering <lennart@poettering.net>, 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Sun, 12 May 2013 08:02:31 +0200
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



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Mon, 13 May 2013 08:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 13 May 2013 08:06:04 GMT) Full text and rfc822 format available.

Message #183 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Noah Meyerhans <noahm@debian.org>
Cc: Lennart Poettering <lennart@poettering.net>, 705900@bugs.debian.org, Petter Reinholdtsen <pere@hungry.com>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 13 May 2013 10:03:37 +0200
[Message part 1 (text/plain, inline)]
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).

Greetings,
Joachim

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

[test.c (text/x-csrc, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Mon, 13 May 2013 08:45:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 13 May 2013 08:45:07 GMT) Full text and rfc822 format available.

Message #188 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: 705900@bugs.debian.org
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 13 May 2013 10:43:57 +0200
[Message part 1 (text/plain, inline)]
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

Greetings,
Joachim

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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Mon, 13 May 2013 13:39:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Poettering <lennart@poettering.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 13 May 2013 13:39:22 GMT) Full text and rfc822 format available.

Message #193 received at 705900@bugs.debian.org (full text, mbox):

From: Lennart Poettering <lennart@poettering.net>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: Joachim Breitner <nomeata@debian.org>, Noah Meyerhans <noahm@debian.org>, 705900@bugs.debian.org, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 13 May 2013 15:38:22 +0200
On Sun, 12.05.13 08:02, Petter Reinholdtsen (pere@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.



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Mon, 13 May 2013 13:42:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Poettering <lennart@poettering.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 13 May 2013 13:42:11 GMT) Full text and rfc822 format available.

Message #198 received at 705900@bugs.debian.org (full text, mbox):

From: Lennart Poettering <lennart@poettering.net>
To: Joachim Breitner <nomeata@debian.org>
Cc: Noah Meyerhans <noahm@debian.org>, 705900@bugs.debian.org, Petter Reinholdtsen <pere@hungry.com>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 13 May 2013 15:40:16 +0200
On Mon, 13.05.13 10:03, Joachim Breitner (nomeata@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?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Mon, 13 May 2013 13:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 13 May 2013 13:45:04 GMT) Full text and rfc822 format available.

Message #203 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Lennart Poettering <lennart@poettering.net>
Cc: Noah Meyerhans <noahm@debian.org>, 705900@bugs.debian.org, Petter Reinholdtsen <pere@hungry.com>, Jan Wagner <waja@cyconet.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Mon, 13 May 2013 15:42:27 +0200
[Message part 1 (text/plain, inline)]
Hi,

Am Montag, den 13.05.2013, 15:40 +0200 schrieb Lennart Poettering:
> On Mon, 13.05.13 10:03, Joachim Breitner (nomeata@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?

Greetings,
Joachim

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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Mon, 13 May 2013 23:15:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Mon, 13 May 2013 23:15:09 GMT) Full text and rfc822 format available.

Message #208 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 14 May 2013 01:14:13 +0200
[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. :)

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Tue, 21 May 2013 13:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Tue, 21 May 2013 13:51:04 GMT) Full text and rfc822 format available.

Message #213 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: 705900@bugs.debian.org
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 21 May 2013 15:46:33 +0200
[Message part 1 (text/plain, inline)]
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.

Greetings,
Joachim

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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#705900; Package libc6. (Tue, 21 May 2013 18:18:19 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>. (Tue, 21 May 2013 18:18:19 GMT) Full text and rfc822 format available.

Message #218 received at 705900@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 705900@bugs.debian.org, Joachim Breitner <nomeata@debian.org>
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Tue, 21 May 2013 20:17:45 +0200
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.

-- 
Happy hacking
Petter Reinholdtsen



Bug reassigned from package 'libc6' to 'libnss-myhostname'. Request was from Petter Reinholdtsen <pere@hungry.com> to control@bugs.debian.org. (Tue, 21 May 2013 18:18:22 GMT) Full text and rfc822 format available.

Changed Bug title to 'Do not return link-local addresses' from 'getaddrinfo() should set sin6_scope_id' Request was from Joachim Breitner <nomeata@debian.org> to control@bugs.debian.org. (Wed, 22 May 2013 10:51:14 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#705900; Package libnss-myhostname. (Wed, 22 May 2013 11:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joachim Breitner <nomeata@debian.org>:
Extra info received and forwarded to list. (Wed, 22 May 2013 11:03:04 GMT) Full text and rfc822 format available.

Message #227 received at 705900@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: 705900@bugs.debian.org
Subject: Re: Bug#705900: check_ping fail if host do not have IPv6 address
Date: Wed, 22 May 2013 13:02:02 +0200
[Message part 1 (text/plain, inline)]
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

Greetings,
Joachim

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

[signature.asc (application/pgp-signature, inline)]

Reply sent to Joachim Breitner <nomeata@debian.org>:
You have taken responsibility. (Wed, 29 May 2013 21:36:05 GMT) Full text and rfc822 format available.

Notification sent to Petter Reinholdtsen <pere@hungry.com>:
Bug acknowledged by developer. (Wed, 29 May 2013 21:36:05 GMT) Full text and rfc822 format available.

Message #232 received at 705900-close@bugs.debian.org (full text, mbox):

From: Joachim Breitner <nomeata@debian.org>
To: 705900-close@bugs.debian.org
Subject: Bug#705900: fixed in libnss-myhostname 0.3-5~deb7u1
Date: Wed, 29 May 2013 21:32:05 +0000
Source: libnss-myhostname
Source-Version: 0.3-5~deb7u1

We believe that the bug you reported is fixed in the latest version of
libnss-myhostname, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 705900@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joachim Breitner <nomeata@debian.org> (supplier of updated libnss-myhostname package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 29 May 2013 20:05:35 +0200
Source: libnss-myhostname
Binary: libnss-myhostname
Architecture: source amd64
Version: 0.3-5~deb7u1
Distribution: stable
Urgency: low
Maintainer: Joachim Breitner <nomeata@debian.org>
Changed-By: Joachim Breitner <nomeata@debian.org>
Description: 
 libnss-myhostname - nss module providing fallback resolution for the current hostname
Closes: 705900
Changes: 
 libnss-myhostname (0.3-5~deb7u1) stable; urgency=low
 .
   * Ignore link-local addresses (Closes: #705900)
Checksums-Sha1: 
 e802a5d11e420b0896fa7b28bcefaa8b183fbaf7 1327 libnss-myhostname_0.3-5~deb7u1.dsc
 cda552f5c3b9a44d027c7ee5fffc6890fb718f52 8467 libnss-myhostname_0.3-5~deb7u1.debian.tar.gz
 4d094fb791f956d005ccfdd0d36a4d98b3fb64bc 14382 libnss-myhostname_0.3-5~deb7u1_amd64.deb
Checksums-Sha256: 
 836cd75f20903600e82e5923fa4dd842eb816c767828df88e8248295f22875e2 1327 libnss-myhostname_0.3-5~deb7u1.dsc
 0c16ebd71da3e807c254b0b9f2a0b45eda474e486e36c2c9536025422780cb30 8467 libnss-myhostname_0.3-5~deb7u1.debian.tar.gz
 bbe9bf495c856489a38e37f09501cfc500e0e41d131757ef9801905c1c1965f2 14382 libnss-myhostname_0.3-5~deb7u1_amd64.deb
Files: 
 e1b1e4ee87fcdad54aef1ace52f26910 1327 admin extra libnss-myhostname_0.3-5~deb7u1.dsc
 8b4e436edce8cc648672a7b98be18a01 8467 admin extra libnss-myhostname_0.3-5~deb7u1.debian.tar.gz
 8471d23f3fde3b409a394df55cdbf93f 14382 admin extra libnss-myhostname_0.3-5~deb7u1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlGmRIoACgkQ9ijrk0dDIGw2zACghpHVnEfSF2SvdHOTSsi4Lulh
O60An0q1NYXD/SAqdkmpTCffU+DoEUnv
=QO4s
-----END PGP SIGNATURE-----




Marked as fixed in versions libnss-myhostname/0.3-5. Request was from Joachim Breitner <nomeata@debian.org> to control@bugs.debian.org. (Wed, 29 May 2013 21:48:07 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 29 Jun 2013 07:25:38 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 13:05:50 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.