Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2021 12:52:22 +0200
From:      Michael Gmelin <freebsd@grem.de>
To:        =?UTF-8?B?w5Z6a2Fu?= KIRIK <ozkan.kirik@gmail.com>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: jail - vnet bug - ping: UDP connect: No route to host
Message-ID:  <20210412125222.16610891@bsd64.grem.de>
In-Reply-To: <CAAcX-AGd0=Kf-VnwywyHFEM9jUocO%2BZP4LK0XYBijgz-Pd%2BUGg@mail.gmail.com>
References:  <CAAcX-AGd0=Kf-VnwywyHFEM9jUocO%2BZP4LK0XYBijgz-Pd%2BUGg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Sun, 11 Apr 2021 07:42:23 +0300
=C3=96zkan KIRIK <ozkan.kirik@gmail.com> wrote:

> Hello,
>=20
>=20
> root@f13:~ # jexec client ping www.google.com
> ping: UDP connect: No route to host
>=20
> root@f13:~ # jexec client ping -4 -c 2 www.google.com
> PING www.google.com (216.58.212.100): 56 data bytes
> 64 bytes from 216.58.212.100: icmp_seq=3D0 ttl=3D128 time=3D85.487 ms
> 64 bytes from 216.58.212.100: icmp_seq=3D1 ttl=3D128 time=3D90.243 ms
>=20
> --- www.google.com ping statistics ---
> 2 packets transmitted, 2 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev =3D 85.487/87.865/90.243/2.378 ms
> root@f13:~ #

That's interesting - ping6 was merged into ping last year, the basic
logic of deciding which AF to use is here:

https://cgit.freebsd.org/src/tree/sbin/ping/main.c#n128

Essentially it does:

1. IPv6 disabled? Use IPv4
else
2. IPv4 disabled? Use IPv6
else
3. do hostname lookup and decide based on the AF of the first result.

As far as I can tell, the result of 3. is not used for the ping though,
but only to decide if ping6 or ping should be done. I wonder if this is
actually a good idea - gut feeling-wise I would prefer only one lookup
to take place when calling ping.

That said, what happens if you call:

  jexec client ping -6 -c 2 www.google.com

I assume that should give you some output (including an IP address),
even though the ping6 itself will fail.

Also, what is your /etc/resolv.conf inside the jail?

I suspect that the problem is caused by the gethostbyaddr call in 3.
and is not directly IPv6 related - if I compare the code used by ping.c
and ping6.c (including capsicum support) with what 3. does, we might
have a bigger problem here.

Best,
Michael

> _______________________________________________
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"



--=20
Michael Gmelin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210412125222.16610891>