Discussion:
jail - vnet bug - ping: UDP connect: No route to host
Özkan KIRIK
2021-04-11 04:42:23 UTC
Permalink
Hello,

There is something wrong about routing lookup on vnet-jails. Although my
jail doesn't have IPv6 address, it tries to use IPv6 by default and
get "ping: UDP connect: No route to host" error. But it works by forcing to
use IPv4.

The problem is reproducable. This is a fresh insallation of FreeBSD
13.0-RC5:

***@f13:~ # uname -a
FreeBSD f13 13.0-RC5 FreeBSD 13.0-RC5 #0 releng/13.0-n244727-f8a134d0ef1:
Fri Apr 2 04:29:19 UTC 2021
***@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64

***@f13:~ # jail -c name=client persist vnet vnet.interface=em1

***@f13:~ # jexec client dhclient em1
DHCPREQUEST on em1 to 255.255.255.255 port 67
DHCPACK from 172.16.33.254
bound to 172.16.33.135 -- renewal in 900 seconds.

***@f13:~ # jexec client ifconfig em1
em1: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
ether 00:0c:29:3b:2a:de
inet 172.16.33.135 netmask 0xffffff00 broadcast 172.16.33.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

***@f13:~ # jexec client host www.google.com
www.google.com has address 216.58.212.100
www.google.com has IPv6 address 2a00:1450:4006:80b::2004

***@f13:~ # jexec client ping www.google.com
ping: UDP connect: No route to host

***@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=0 ttl=128 time=85.487 ms
64 bytes from 216.58.212.100: icmp_seq=1 ttl=128 time=90.243 ms

--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.487/87.865/90.243/2.378 ms
***@f13:~ #
Michael Gmelin
2021-04-12 10:52:22 UTC
Permalink
On Sun, 11 Apr 2021 07:42:23 +0300
Post by Özkan KIRIK
Hello,
ping: UDP connect: No route to host
PING www.google.com (216.58.212.100): 56 data bytes
64 bytes from 216.58.212.100: icmp_seq=0 ttl=128 time=85.487 ms
64 bytes from 216.58.212.100: icmp_seq=1 ttl=128 time=90.243 ms
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.487/87.865/90.243/2.378 ms
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
Post by Özkan KIRIK
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
--
Michael Gmelin
Özkan KIRIK
2021-04-12 12:28:16 UTC
Permalink
Hello

the output is below:

***@f13:~ # cat /etc/resolv.conf
# Generated by resolvconf
nameserver 8.8.8.8

The jail uses same resolv.conf with host, because path is /

***@f13:~ # jls -N
JID IP Address Hostname Path
client /

***@f13:~ # jexec client ping -6 -c 2 www.google.com
ping: UDP connect: No route to host

***@f13:~ # jexec client truss ping -6 -c 2 www.google.com
mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362036224 (0x800231000)
mprotect(0x80022e000,4096,PROT_READ) = 0 (0x0)
issetugid() = 0 (0x0)
sigfastblock(0x1,0x8002304d0) = 0 (0x0)
open("/etc/libmap.conf",O_RDONLY|O_CLOEXEC,010575650) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=4807776,size=47,blksize=32768 }) = 0 (0x0)
read(3,"# $FreeBSD$\nincludedir /usr/loc"...,47) = 47 (0x2f)
close(3) = 0 (0x0)
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165)
ERR#2 'No such file or directory'
open("/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,010014544) = 3 (0x3)
read(3,"Ehnt\^A\0\0\0\M^@\0\0\0G\0\0\0\0"...,128) = 128 (0x80)
fstat(3,{ mode=-r--r--r-- ,inode=3446022,size=199,blksize=32768 }) = 0 (0x0)
pread(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,71,0x80) = 71 (0x47)
close(3) = 0 (0x0)
open("/lib/libm.so.5",O_RDONLY|O_CLOEXEC|O_VERIFY,032266000) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727581,size=195816,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,208896,PROT_NONE,MAP_GUARD,-1,0x0) = 34362175488 (0x800253000)
mmap(0x800253000,73728,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362175488 (0x800253000)
mmap(0x800265000,122880,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x11000)
= 34362249216 (0x800265000)
mmap(0x800283000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
= 34362372096 (0x800283000)
mmap(0x800284000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
= 34362376192 (0x800284000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libmd.so.6",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727558,size=109536,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,122880,PROT_NONE,MAP_GUARD,-1,0x0) = 34362384384 (0x800286000)
mmap(0x800286000,32768,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362384384 (0x800286000)
mmap(0x80028e000,77824,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x7000)
= 34362417152 (0x80028e000)
mmap(0x8002a1000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x19000)
= 34362494976 (0x8002a1000)
mmap(0x8002a3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1a000)
= 34362503168 (0x8002a3000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcasper.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727576,size=23280,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,36864,PROT_NONE,MAP_GUARD,-1,0x0) = 34362507264 (0x8002a4000)
mmap(0x8002a4000,12288,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362507264 (0x8002a4000)
mmap(0x8002a7000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x2000)
= 34362519552 (0x8002a7000)
mmap(0x8002aa000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
= 34362531840 (0x8002aa000)
mmap(0x8002ab000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
= 34362535936 (0x8002ab000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such
file or directory'
open("/usr/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No
such file or directory'
open("/usr/lib/compat/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2
'No such file or directory'
open("/usr/local/lib/compat/pkg/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/lib/casper/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727640,size=17528,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,28672,PROT_NONE,MAP_GUARD,-1,0x0) = 34362544128 (0x8002ad000)
mmap(0x8002ad000,8192,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362544128 (0x8002ad000)
mmap(0x8002af000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x1000)
= 34362552320 (0x8002af000)
mmap(0x8002b2000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
= 34362564608 (0x8002b2000)
mmap(0x8002b3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
= 34362568704 (0x8002b3000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libipsec.so.4",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727575,size=31384,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,45056,PROT_NONE,MAP_GUARD,-1,0x0) = 34362572800 (0x8002b4000)
mmap(0x8002b4000,16384,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362572800 (0x8002b4000)
mmap(0x8002b8000,16384,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x3000)
= 34362589184 (0x8002b8000)
mmap(0x8002bc000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
= 34362605568 (0x8002bc000)
mmap(0x8002bd000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
= 34362609664 (0x8002bd000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727578,size=1981952,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,4263936,PROT_NONE,MAP_GUARD,-1,0x0) = 34362617856 (0x8002bf000)
mmap(0x8002bf000,540672,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362617856 (0x8002bf000)
mmap(0x800343000,1384448,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x83000)
= 34363158528 (0x800343000)
mmap(0x800495000,40960,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1d4000)
= 34364542976 (0x800495000)
mmap(0x80049f000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1dd000)
= 34364583936 (0x80049f000)
mmap(0x8004a6000,2269184,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0)
= 34364612608 (0x8004a6000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libnv.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727585,size=91728,blksize=32768 }) = 0
(0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34362171392
(0x800252000)
mmap(0x0,102400,PROT_NONE,MAP_GUARD,-1,0x0) = 34366881792 (0x8006d0000)
mmap(0x8006d0000,40960,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34366881792 (0x8006d0000)
mmap(0x8006da000,53248,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x9000)
= 34366922752 (0x8006da000)
mmap(0x8006e7000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
= 34366976000 (0x8006e7000)
mmap(0x8006e8000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
= 34366980096 (0x8006e8000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
mprotect(0x800283000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002a1000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002aa000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002b2000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002bc000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
mprotect(0x8006e7000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ|PROT_WRITE) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
readlink("/etc/malloc.conf",0x7fffffffd600,1024) ERR#2 'No such file or
directory'
issetugid() = 0 (0x0)
__sysctl("vm.overcommit",2,0x7fffffffbb94,0x7fffffffbb88,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
= 34368126976 (0x800800000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0)
= 34370224128 (0x800a00000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
= 34372321280 (0x800c00000)
mprotect(0x210000,4096,PROT_READ) = 0 (0x0)
socketpair(0x1,0x20000001,0x0,0x7fffffffba98) = 0 (0x0)
pdfork(0x7fffffffba94,0x0) = 1477 (0x5c5)
close(4) = 0 (0x0)
fcntl(3,F_GETFL,) = 6 (0x6)
fcntl(5,F_GETFL,) = 2 (0x2)
select(4,0x0,{ 3 },0x0,0x0) = 1 (0x1)
sendto(3,"l\0\0\0\0\0\0\0\0\0\0B\0\0\0\0\0"...,85,0,NULL,0) = 85 (0x55)
select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"l\0\0\^A\0\0\0\0\0\0\0h\0\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"\^F\a\0\b\0\0\0\0\0\0\0\0\0\0\0"...,104,0,NULL,0x0) = 104 (0x68)
select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvmsg(3,{NULL,0,[{"\0",1}],1,{{level=SOL_SOCKET,type=SCM_RIGHTS,data={0x04,0x00,0x00,0x00}}},24,0x40000},0x40000)
= 1 (0x1)
fcntl(4,F_GETFL,) = 6 (0x6)
close(5) = 0 (0x0)
close(3) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52 (0x34)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0;\0\0\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^A\a\0\0\0\0\0\0\0\0\0\0\0\0\0"...,59,0,NULL,0x0) = 59 (0x3b)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187 (0xbb)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33 (0x21)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52 (0x34)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0z\0\0\0\0\0\0\0\0\0\0\0\0"...,168,0,NULL,0x0) = 168
(0xa8)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,222,0,NULL,0) = 222 (0xde)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33 (0x21)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-}\0\0\0"...,272,0,NULL,0) = 272 (0x110)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0]\^A\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\^E\0001\^A\0\0\0\0\0\0\0\0\0"...,349,0,NULL,0x0) = 349
(0x15d)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 3 (0x3)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 5 (0x5)
getuid() = 0 (0x0)
seteuid(0x0) = 0 (0x0)
getuid() = 0 (0x0)
setuid(0x0) = 0 (0x0)
getpid() = 1476 (0x5c4)
mmap(0x0,1112,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362171392 (0x800252000)
minherit(0x800252000,1112,INHERIT_ZERO) = 0 (0x0)
getrandom("m\M^X\^U\M-I\M^XP\M-e^\M-R\^UE"...,40,0) = 40 (0x28)
setsockopt(3,IPPROTO_IPV6,IPV6_USE_MIN_MTU,0x7fffffffe944,4) = 0 (0x0)
setsockopt(5,IPPROTO_ICMPV6,18,0x7fffffffbad0,32) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52 (0x34)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0\M^]\0\0\0\0\0\0\0\0\0\0"...,203,0,NULL,0x0) = 203 (0xcb)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187 (0xbb)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19 (0x13)
select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33 (0x21)
socket(PF_INET6,SOCK_DGRAM,0) = 6 (0x6)
connect(6,{ AF_INET6 [2a00:1450:4006:802::2004]:10101 },28) ERR#65 'No
route to host'
ping: write(2,"ping: ",6) = 6 (0x6)
UDP connectwrite(2,"UDP connect",11) = 11 (0xb)
: write(2,": ",2) = 2 (0x2)
fstatat(AT_FDCWD,"/usr/share/nls/C/libc.cat",0x7fffffffb7f0,0x0) ERR#2 'No
such file or directory'
fstatat(AT_FDCWD,"/usr/share/nls/libc/C",0x7fffffffb7f0,0x0) ERR#2 'No such
file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/libc/C",0x7fffffffb7f0,0x0) ERR#2
'No such file or directory'
No route to host
write(2,"No route to host\n",17) = 17 (0x11)
exit(0x1)
process exit, rval = 1
Post by Michael Gmelin
On Sun, 11 Apr 2021 07:42:23 +0300
Post by Özkan KIRIK
Hello,
ping: UDP connect: No route to host
PING www.google.com (216.58.212.100): 56 data bytes
64 bytes from 216.58.212.100: icmp_seq=0 ttl=128 time=85.487 ms
64 bytes from 216.58.212.100: icmp_seq=1 ttl=128 time=90.243 ms
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.487/87.865/90.243/2.378 ms
That's interesting - ping6 was merged into ping last year, the basic
https://cgit.freebsd.org/src/tree/sbin/ping/main.c#n128
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.
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
Post by Özkan KIRIK
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
--
Michael Gmelin
Michael Gmelin
2021-04-12 12:38:52 UTC
Permalink
On Mon, 12 Apr 2021 15:28:16 +0300
Post by Özkan KIRIK
Hello
# Generated by resolvconf
nameserver 8.8.8.8
The jail uses same resolv.conf with host, because path is /
So you run a jail on top of / ?

Can you share the output of `jls -s -j <jailname>` with us?

-m
Post by Özkan KIRIK
JID IP Address Hostname Path
client /
ping: UDP connect: No route to host
mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362036224 (0x800231000)
mprotect(0x80022e000,4096,PROT_READ) = 0 (0x0)
issetugid() = 0 (0x0)
sigfastblock(0x1,0x8002304d0) = 0 (0x0)
open("/etc/libmap.conf",O_RDONLY|O_CLOEXEC,010575650) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=4807776,size=47,blksize=32768 }) = 0
(0x0) read(3,"# $FreeBSD$\nincludedir /usr/loc"...,47) = 47 (0x2f)
close(3) = 0 (0x0)
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165)
ERR#2 'No such file or directory'
open("/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,010014544) = 3
fstat(3,{ mode=-r--r--r-- ,inode=3446022,size=199,blksize=32768 }) =
0 (0x0) pread(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,71,0x80) = 71
(0x47) close(3) = 0 (0x0)
open("/lib/libm.so.5",O_RDONLY|O_CLOEXEC|O_VERIFY,032266000) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727581,size=195816,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,208896,PROT_NONE,MAP_GUARD,-1,0x0) = 34362175488
(0x800253000)
mmap(0x800253000,73728,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362175488 (0x800253000)
mmap(0x800265000,122880,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x11000)
= 34362249216 (0x800265000)
mmap(0x800283000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
= 34362372096 (0x800283000)
mmap(0x800284000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
= 34362376192 (0x800284000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libmd.so.6",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) = 3
(0x3) fstat(3,{ mode=-r--r--r--
,inode=4727558,size=109536,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,122880,PROT_NONE,MAP_GUARD,-1,0x0) = 34362384384
(0x800286000)
mmap(0x800286000,32768,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362384384 (0x800286000)
mmap(0x80028e000,77824,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x7000)
= 34362417152 (0x80028e000)
mmap(0x8002a1000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x19000)
= 34362494976 (0x8002a1000)
mmap(0x8002a3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1a000)
= 34362503168 (0x8002a3000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcasper.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727576,size=23280,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,36864,PROT_NONE,MAP_GUARD,-1,0x0) = 34362507264 (0x8002a4000)
mmap(0x8002a4000,12288,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362507264 (0x8002a4000)
mmap(0x8002a7000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x2000)
= 34362519552 (0x8002a7000)
mmap(0x8002aa000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
= 34362531840 (0x8002aa000)
mmap(0x8002ab000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
= 34362535936 (0x8002ab000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No
such file or directory'
open("/usr/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2
'No such file or directory'
open("/usr/lib/compat/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/compat/pkg/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/lib/casper/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) =
3 (0x3) fstat(3,{ mode=-r--r--r--
,inode=4727640,size=17528,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,28672,PROT_NONE,MAP_GUARD,-1,0x0) = 34362544128 (0x8002ad000)
mmap(0x8002ad000,8192,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362544128 (0x8002ad000)
mmap(0x8002af000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x1000)
= 34362552320 (0x8002af000)
mmap(0x8002b2000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
= 34362564608 (0x8002b2000)
mmap(0x8002b3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
= 34362568704 (0x8002b3000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libipsec.so.4",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727575,size=31384,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,45056,PROT_NONE,MAP_GUARD,-1,0x0) = 34362572800 (0x8002b4000)
mmap(0x8002b4000,16384,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362572800 (0x8002b4000)
mmap(0x8002b8000,16384,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x3000)
= 34362589184 (0x8002b8000)
mmap(0x8002bc000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
= 34362605568 (0x8002bc000)
mmap(0x8002bd000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
= 34362609664 (0x8002bd000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727578,size=1981952,blksize=32768
}) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,4263936,PROT_NONE,MAP_GUARD,-1,0x0) = 34362617856
(0x8002bf000)
mmap(0x8002bf000,540672,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34362617856 (0x8002bf000)
mmap(0x800343000,1384448,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x83000)
= 34363158528 (0x800343000)
mmap(0x800495000,40960,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1d4000)
= 34364542976 (0x800495000)
mmap(0x80049f000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1dd000)
= 34364583936 (0x80049f000)
mmap(0x8004a6000,2269184,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0)
= 34364612608 (0x8004a6000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libnv.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727585,size=91728,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,102400,PROT_NONE,MAP_GUARD,-1,0x0) = 34366881792
(0x8006d0000)
mmap(0x8006d0000,40960,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
= 34366881792 (0x8006d0000)
mmap(0x8006da000,53248,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x9000)
= 34366922752 (0x8006da000)
mmap(0x8006e7000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
= 34366976000 (0x8006e7000)
mmap(0x8006e8000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
= 34366980096 (0x8006e8000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
mprotect(0x800283000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002a1000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002aa000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002b2000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002bc000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
mprotect(0x8006e7000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ|PROT_WRITE) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
readlink("/etc/malloc.conf",0x7fffffffd600,1024) ERR#2 'No such file
or directory'
issetugid() = 0 (0x0)
__sysctl("vm.overcommit",2,0x7fffffffbb94,0x7fffffffbb88,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
= 34368126976 (0x800800000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0)
= 34370224128 (0x800a00000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
= 34372321280 (0x800c00000) mprotect(0x210000,4096,PROT_READ) = 0
(0x0) socketpair(0x1,0x20000001,0x0,0x7fffffffba98) = 0 (0x0)
pdfork(0x7fffffffba94,0x0) = 1477 (0x5c5)
close(4) = 0 (0x0)
fcntl(3,F_GETFL,) = 6 (0x6)
fcntl(5,F_GETFL,) = 2 (0x2)
select(4,0x0,{ 3 },0x0,0x0) = 1 (0x1)
sendto(3,"l\0\0\0\0\0\0\0\0\0\0B\0\0\0\0\0"...,85,0,NULL,0) = 85
(0x55) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"l\0\0\^A\0\0\0\0\0\0\0h\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"\^F\a\0\b\0\0\0\0\0\0\0\0\0\0\0"...,104,0,NULL,0x0) = 104
(0x68) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvmsg(3,{NULL,0,[{"\0",1}],1,{{level=SOL_SOCKET,type=SCM_RIGHTS,data={0x04,0x00,0x00,0x00}}},24,0x40000},0x40000)
= 1 (0x1)
fcntl(4,F_GETFL,) = 6 (0x6)
close(5) = 0 (0x0)
close(3) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0;\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^A\a\0\0\0\0\0\0\0\0\0\0\0\0\0"...,59,0,NULL,0x0) = 59
(0x3b) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187
(0xbb) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33
(0x21) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0z\0\0\0\0\0\0\0\0\0\0\0\0"...,168,0,NULL,0x0) = 168
(0xa8)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,222,0,NULL,0) = 222
(0xde) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33
(0x21) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-}\0\0\0"...,272,0,NULL,0) = 272
(0x110) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0]\^A\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\^E\0001\^A\0\0\0\0\0\0\0\0\0"...,349,0,NULL,0x0) = 349
(0x15d)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 3 (0x3)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 5 (0x5)
getuid() = 0 (0x0)
seteuid(0x0) = 0 (0x0)
getuid() = 0 (0x0)
setuid(0x0) = 0 (0x0)
getpid() = 1476 (0x5c4)
mmap(0x0,1112,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362171392 (0x800252000)
minherit(0x800252000,1112,INHERIT_ZERO) = 0 (0x0)
getrandom("m\M^X\^U\M-I\M^XP\M-e^\M-R\^UE"...,40,0) = 40 (0x28)
setsockopt(3,IPPROTO_IPV6,IPV6_USE_MIN_MTU,0x7fffffffe944,4) = 0 (0x0)
setsockopt(5,IPPROTO_ICMPV6,18,0x7fffffffbad0,32) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0\M^]\0\0\0\0\0\0\0\0\0\0"...,203,0,NULL,0x0) = 203
(0xcb) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187
(0xbb) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33
(0x21) socket(PF_INET6,SOCK_DGRAM,0) = 6 (0x6)
connect(6,{ AF_INET6 [2a00:1450:4006:802::2004]:10101 },28) ERR#65 'No
route to host'
ping: write(2,"ping: ",6) = 6 (0x6)
UDP connectwrite(2,"UDP connect",11) = 11 (0xb)
: write(2,": ",2) = 2 (0x2)
fstatat(AT_FDCWD,"/usr/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/share/nls/libc/C",0x7fffffffb7f0,0x0) ERR#2
'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/libc/C",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
No route to host
write(2,"No route to host\n",17) = 17 (0x11)
exit(0x1)
process exit, rval = 1
Post by Michael Gmelin
On Sun, 11 Apr 2021 07:42:23 +0300
Post by Özkan KIRIK
Hello,
ping: UDP connect: No route to host
PING www.google.com (216.58.212.100): 56 data bytes
64 bytes from 216.58.212.100: icmp_seq=0 ttl=128 time=85.487 ms
64 bytes from 216.58.212.100: icmp_seq=1 ttl=128 time=90.243 ms
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.487/87.865/90.243/2.378 ms
That's interesting - ping6 was merged into ping last year, the basic
https://cgit.freebsd.org/src/tree/sbin/ping/main.c#n128
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.
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
Post by Özkan KIRIK
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to
--
Michael Gmelin
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
--
Michael Gmelin
Özkan KIRIK
2021-04-12 14:45:36 UTC
Permalink
***@f13:~ # jls -s -j client
devfs_ruleset=0 enforce_statfs=2 host=new ip4=inherit ip6=inherit jid=2
name=client osreldate=1300139 osrelease=13.0-RC5 path=/ persist
securelevel=-1 sysvmsg=disable sysvsem=disable sysvshm=disable vnet=new
allow.nochflags allow.nomlock allow.nomount allow.mount.nodevfs
allow.mount.noprocfs allow.mount.notmpfs allow.noquotas allow.noraw_sockets
allow.noread_msgbuf allow.reserved_ports allow.set_hostname
allow.nosocket_af allow.suser allow.nosysvipc allow.unprivileged_proc_debug
children.max=0 host.domainname="" host.hostid=0 host.hostname=""
host.hostuuid=00000000-0000-0000-0000-000000000000
Post by Michael Gmelin
On Mon, 12 Apr 2021 15:28:16 +0300
Post by Özkan KIRIK
Hello
# Generated by resolvconf
nameserver 8.8.8.8
The jail uses same resolv.conf with host, because path is /
So you run a jail on top of / ?
Can you share the output of `jls -s -j <jailname>` with us?
-m
Post by Özkan KIRIK
JID IP Address Hostname Path
client /
ping: UDP connect: No route to host
mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362036224 (0x800231000)
mprotect(0x80022e000,4096,PROT_READ) = 0 (0x0)
issetugid() = 0 (0x0)
sigfastblock(0x1,0x8002304d0) = 0 (0x0)
open("/etc/libmap.conf",O_RDONLY|O_CLOEXEC,010575650) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=4807776,size=47,blksize=32768 }) = 0
(0x0) read(3,"# $FreeBSD$\nincludedir /usr/loc"...,47) = 47 (0x2f)
close(3) = 0 (0x0)
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165)
Post by Özkan KIRIK
ERR#2 'No such file or directory'
open("/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,010014544) = 3
fstat(3,{ mode=-r--r--r-- ,inode=3446022,size=199,blksize=32768 }) =
0 (0x0) pread(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,71,0x80) = 71
(0x47) close(3) = 0 (0x0)
open("/lib/libm.so.5",O_RDONLY|O_CLOEXEC|O_VERIFY,032266000) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727581,size=195816,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,208896,PROT_NONE,MAP_GUARD,-1,0x0) = 34362175488
(0x800253000)
mmap(0x800253000,73728,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362175488 (0x800253000)
mmap(0x800265000,122880,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x11000)
Post by Özkan KIRIK
= 34362249216 (0x800265000)
mmap(0x800283000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
Post by Özkan KIRIK
= 34362372096 (0x800283000)
mmap(0x800284000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
Post by Özkan KIRIK
= 34362376192 (0x800284000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libmd.so.6",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) = 3
(0x3) fstat(3,{ mode=-r--r--r--
,inode=4727558,size=109536,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,122880,PROT_NONE,MAP_GUARD,-1,0x0) = 34362384384
(0x800286000)
mmap(0x800286000,32768,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362384384 (0x800286000)
mmap(0x80028e000,77824,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x7000)
Post by Özkan KIRIK
= 34362417152 (0x80028e000)
mmap(0x8002a1000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x19000)
Post by Özkan KIRIK
= 34362494976 (0x8002a1000)
mmap(0x8002a3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1a000)
Post by Özkan KIRIK
= 34362503168 (0x8002a3000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcasper.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727576,size=23280,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,36864,PROT_NONE,MAP_GUARD,-1,0x0) = 34362507264 (0x8002a4000)
mmap(0x8002a4000,12288,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362507264 (0x8002a4000)
mmap(0x8002a7000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x2000)
Post by Özkan KIRIK
= 34362519552 (0x8002a7000)
mmap(0x8002aa000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
Post by Özkan KIRIK
= 34362531840 (0x8002aa000)
mmap(0x8002ab000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
Post by Özkan KIRIK
= 34362535936 (0x8002ab000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No
such file or directory'
open("/usr/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2
'No such file or directory'
open("/usr/lib/compat/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/compat/pkg/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
Post by Özkan KIRIK
ERR#2 'No such file or directory'
open("/lib/casper/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) =
3 (0x3) fstat(3,{ mode=-r--r--r--
,inode=4727640,size=17528,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,28672,PROT_NONE,MAP_GUARD,-1,0x0) = 34362544128 (0x8002ad000)
mmap(0x8002ad000,8192,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362544128 (0x8002ad000)
mmap(0x8002af000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x1000)
Post by Özkan KIRIK
= 34362552320 (0x8002af000)
mmap(0x8002b2000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
Post by Özkan KIRIK
= 34362564608 (0x8002b2000)
mmap(0x8002b3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
Post by Özkan KIRIK
= 34362568704 (0x8002b3000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libipsec.so.4",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727575,size=31384,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,45056,PROT_NONE,MAP_GUARD,-1,0x0) = 34362572800 (0x8002b4000)
mmap(0x8002b4000,16384,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362572800 (0x8002b4000)
mmap(0x8002b8000,16384,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x3000)
Post by Özkan KIRIK
= 34362589184 (0x8002b8000)
mmap(0x8002bc000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
Post by Özkan KIRIK
= 34362605568 (0x8002bc000)
mmap(0x8002bd000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
Post by Özkan KIRIK
= 34362609664 (0x8002bd000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727578,size=1981952,blksize=32768
}) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,4263936,PROT_NONE,MAP_GUARD,-1,0x0) = 34362617856
(0x8002bf000)
mmap(0x8002bf000,540672,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362617856 (0x8002bf000)
mmap(0x800343000,1384448,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x83000)
Post by Özkan KIRIK
= 34363158528 (0x800343000)
mmap(0x800495000,40960,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1d4000)
Post by Özkan KIRIK
= 34364542976 (0x800495000)
mmap(0x80049f000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1dd000)
Post by Özkan KIRIK
= 34364583936 (0x80049f000)
mmap(0x8004a6000,2269184,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0)
Post by Özkan KIRIK
= 34364612608 (0x8004a6000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libnv.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727585,size=91728,blksize=32768 })
= 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,102400,PROT_NONE,MAP_GUARD,-1,0x0) = 34366881792
(0x8006d0000)
mmap(0x8006d0000,40960,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34366881792 (0x8006d0000)
mmap(0x8006da000,53248,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x9000)
Post by Özkan KIRIK
= 34366922752 (0x8006da000)
mmap(0x8006e7000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
Post by Özkan KIRIK
= 34366976000 (0x8006e7000)
mmap(0x8006e8000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
Post by Özkan KIRIK
= 34366980096 (0x8006e8000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
mprotect(0x800283000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002a1000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002aa000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002b2000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002bc000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
mprotect(0x8006e7000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ|PROT_WRITE) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
readlink("/etc/malloc.conf",0x7fffffffd600,1024) ERR#2 'No such file
or directory'
issetugid() = 0 (0x0)
__sysctl("vm.overcommit",2,0x7fffffffbb94,0x7fffffffbb88,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
Post by Özkan KIRIK
= 34368126976 (0x800800000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0)
Post by Özkan KIRIK
= 34370224128 (0x800a00000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
Post by Özkan KIRIK
= 34372321280 (0x800c00000) mprotect(0x210000,4096,PROT_READ) = 0
(0x0) socketpair(0x1,0x20000001,0x0,0x7fffffffba98) = 0 (0x0)
pdfork(0x7fffffffba94,0x0) = 1477 (0x5c5)
close(4) = 0 (0x0)
fcntl(3,F_GETFL,) = 6 (0x6)
fcntl(5,F_GETFL,) = 2 (0x2)
select(4,0x0,{ 3 },0x0,0x0) = 1 (0x1)
sendto(3,"l\0\0\0\0\0\0\0\0\0\0B\0\0\0\0\0"...,85,0,NULL,0) = 85
(0x55) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"l\0\0\^A\0\0\0\0\0\0\0h\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"\^F\a\0\b\0\0\0\0\0\0\0\0\0\0\0"...,104,0,NULL,0x0) = 104
(0x68) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvmsg(3,{NULL,0,[{"\0",1}],1,{{level=SOL_SOCKET,type=SCM_RIGHTS,data={0x04,0x00,0x00,0x00}}},24,0x40000},0x40000)
Post by Özkan KIRIK
= 1 (0x1)
fcntl(4,F_GETFL,) = 6 (0x6)
close(5) = 0 (0x0)
close(3) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0;\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^A\a\0\0\0\0\0\0\0\0\0\0\0\0\0"...,59,0,NULL,0x0) = 59
(0x3b) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187
(0xbb) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33
(0x21) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0z\0\0\0\0\0\0\0\0\0\0\0\0"...,168,0,NULL,0x0) = 168
(0xa8)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,222,0,NULL,0) = 222
(0xde) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33
(0x21) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-}\0\0\0"...,272,0,NULL,0) = 272
(0x110) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0]\^A\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\^E\0001\^A\0\0\0\0\0\0\0\0\0"...,349,0,NULL,0x0) = 349
(0x15d)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 3 (0x3)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 5 (0x5)
getuid() = 0 (0x0)
seteuid(0x0) = 0 (0x0)
getuid() = 0 (0x0)
setuid(0x0) = 0 (0x0)
getpid() = 1476 (0x5c4)
mmap(0x0,1112,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362171392 (0x800252000)
minherit(0x800252000,1112,INHERIT_ZERO) = 0 (0x0)
getrandom("m\M^X\^U\M-I\M^XP\M-e^\M-R\^UE"...,40,0) = 40 (0x28)
setsockopt(3,IPPROTO_IPV6,IPV6_USE_MIN_MTU,0x7fffffffe944,4) = 0 (0x0)
setsockopt(5,IPPROTO_ICMPV6,18,0x7fffffffbad0,32) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0\M^]\0\0\0\0\0\0\0\0\0\0"...,203,0,NULL,0x0) = 203
(0xcb) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187
(0xbb) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) = 19
(0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) = 33
(0x21) socket(PF_INET6,SOCK_DGRAM,0) = 6 (0x6)
connect(6,{ AF_INET6 [2a00:1450:4006:802::2004]:10101 },28) ERR#65 'No
route to host'
ping: write(2,"ping: ",6) = 6 (0x6)
UDP connectwrite(2,"UDP connect",11) = 11 (0xb)
: write(2,": ",2) = 2 (0x2)
fstatat(AT_FDCWD,"/usr/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/share/nls/libc/C",0x7fffffffb7f0,0x0) ERR#2
'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/libc/C",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
No route to host
write(2,"No route to host\n",17) = 17 (0x11)
exit(0x1)
process exit, rval = 1
Post by Michael Gmelin
On Sun, 11 Apr 2021 07:42:23 +0300
Post by Özkan KIRIK
Hello,
ping: UDP connect: No route to host
PING www.google.com (216.58.212.100): 56 data bytes
64 bytes from 216.58.212.100: icmp_seq=0 ttl=128 time=85.487 ms
64 bytes from 216.58.212.100: icmp_seq=1 ttl=128 time=90.243 ms
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.487/87.865/90.243/2.378 ms
That's interesting - ping6 was merged into ping last year, the basic
https://cgit.freebsd.org/src/tree/sbin/ping/main.c#n128
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.
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
Post by Özkan KIRIK
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to
--
Michael Gmelin
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
--
Michael Gmelin
Michael Gmelin
2021-04-12 17:57:40 UTC
Permalink
On Mon, 12 Apr 2021 17:45:36 +0300
Post by Özkan KIRIK
devfs_ruleset=0 enforce_statfs=2 host=new ip4=inherit ip6=inherit
jid=2 name=client osreldate=1300139 osrelease=13.0-RC5 path=/ persist
securelevel=-1 sysvmsg=disable sysvsem=disable sysvshm=disable
vnet=new allow.nochflags allow.nomlock allow.nomount
allow.mount.nodevfs allow.mount.noprocfs allow.mount.notmpfs
allow.noquotas allow.noraw_sockets allow.noread_msgbuf
allow.reserved_ports allow.set_hostname allow.nosocket_af allow.suser
allow.nosysvipc allow.unprivileged_proc_debug children.max=0
host.domainname="" host.hostid=0 host.hostname=""
host.hostuuid=00000000-0000-0000-0000-000000000000
I can reproduce the issue now, I'll try to dig deeper into it.

-m
Post by Özkan KIRIK
Post by Michael Gmelin
On Mon, 12 Apr 2021 15:28:16 +0300
Post by Özkan KIRIK
Hello
# Generated by resolvconf
nameserver 8.8.8.8
The jail uses same resolv.conf with host, because path is /
So you run a jail on top of / ?
Can you share the output of `jls -s -j <jailname>` with us?
-m
Post by Özkan KIRIK
JID IP Address Hostname
Path client
/
ping: UDP connect: No route to host
mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0)
= 34362036224 (0x800231000)
mprotect(0x80022e000,4096,PROT_READ) = 0 (0x0)
issetugid() = 0 (0x0)
sigfastblock(0x1,0x8002304d0) = 0 (0x0)
open("/etc/libmap.conf",O_RDONLY|O_CLOEXEC,010575650) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=4807776,size=47,blksize=32768 })
= 0 (0x0) read(3,"# $FreeBSD$\nincludedir /usr/loc"...,47) = 47
(0x2f) close(3) = 0 (0x0)
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165)
Post by Özkan KIRIK
ERR#2 'No such file or directory'
open("/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,010014544) = 3
(0x80) fstat(3,{ mode=-r--r--r--
,inode=3446022,size=199,blksize=32768 }) = 0 (0x0)
pread(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,71,0x80) = 71
(0x47) close(3) = 0 (0x0)
open("/lib/libm.so.5",O_RDONLY|O_CLOEXEC|O_VERIFY,032266000) = 3
(0x3) fstat(3,{ mode=-r--r--r--
,inode=4727581,size=195816,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,208896,PROT_NONE,MAP_GUARD,-1,0x0) = 34362175488
(0x800253000)
mmap(0x800253000,73728,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362175488 (0x800253000)
mmap(0x800265000,122880,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x11000)
Post by Özkan KIRIK
= 34362249216 (0x800265000)
mmap(0x800283000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
Post by Özkan KIRIK
= 34362372096 (0x800283000)
mmap(0x800284000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2e000)
Post by Özkan KIRIK
= 34362376192 (0x800284000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libmd.so.6",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000)
= 3 (0x3) fstat(3,{ mode=-r--r--r--
,inode=4727558,size=109536,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,122880,PROT_NONE,MAP_GUARD,-1,0x0) = 34362384384
(0x800286000)
mmap(0x800286000,32768,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362384384 (0x800286000)
mmap(0x80028e000,77824,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x7000)
Post by Özkan KIRIK
= 34362417152 (0x80028e000)
mmap(0x8002a1000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x19000)
Post by Özkan KIRIK
= 34362494976 (0x8002a1000)
mmap(0x8002a3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1a000)
Post by Özkan KIRIK
= 34362503168 (0x8002a3000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcasper.so.1",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3
(0x3) fstat(3,{ mode=-r--r--r--
,inode=4727576,size=23280,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,36864,PROT_NONE,MAP_GUARD,-1,0x0) = 34362507264
(0x8002a4000)
mmap(0x8002a4000,12288,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362507264 (0x8002a4000)
mmap(0x8002a7000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x2000)
Post by Özkan KIRIK
= 34362519552 (0x8002a7000)
mmap(0x8002aa000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
Post by Özkan KIRIK
= 34362531840 (0x8002aa000)
mmap(0x8002ab000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x4000)
Post by Özkan KIRIK
= 34362535936 (0x8002ab000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2
'No such file or directory'
open("/usr/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/lib/compat/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
ERR#2 'No such file or directory'
open("/usr/local/lib/compat/pkg/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
Post by Özkan KIRIK
ERR#2 'No such file or directory'
open("/lib/casper/libcap_dns.so.2",O_RDONLY|O_CLOEXEC|O_VERIFY,00)
= 3 (0x3) fstat(3,{ mode=-r--r--r--
,inode=4727640,size=17528,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,28672,PROT_NONE,MAP_GUARD,-1,0x0) = 34362544128
(0x8002ad000)
mmap(0x8002ad000,8192,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362544128 (0x8002ad000)
mmap(0x8002af000,12288,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x1000)
Post by Özkan KIRIK
= 34362552320 (0x8002af000)
mmap(0x8002b2000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
Post by Özkan KIRIK
= 34362564608 (0x8002b2000)
mmap(0x8002b3000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x3000)
Post by Özkan KIRIK
= 34362568704 (0x8002b3000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libipsec.so.4",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3
(0x3) fstat(3,{ mode=-r--r--r--
,inode=4727575,size=31384,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,45056,PROT_NONE,MAP_GUARD,-1,0x0) = 34362572800
(0x8002b4000)
mmap(0x8002b4000,16384,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362572800 (0x8002b4000)
mmap(0x8002b8000,16384,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x3000)
Post by Özkan KIRIK
= 34362589184 (0x8002b8000)
mmap(0x8002bc000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
Post by Özkan KIRIK
= 34362605568 (0x8002bc000)
mmap(0x8002bd000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x6000)
Post by Özkan KIRIK
= 34362609664 (0x8002bd000)
munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r--
,inode=4727578,size=1981952,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,4263936,PROT_NONE,MAP_GUARD,-1,0x0) = 34362617856
(0x8002bf000)
mmap(0x8002bf000,540672,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34362617856 (0x8002bf000)
mmap(0x800343000,1384448,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x83000)
Post by Özkan KIRIK
= 34363158528 (0x800343000)
mmap(0x800495000,40960,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1d4000)
Post by Özkan KIRIK
= 34364542976 (0x800495000)
mmap(0x80049f000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1dd000)
Post by Özkan KIRIK
= 34364583936 (0x80049f000)
mmap(0x8004a6000,2269184,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0)
Post by Özkan KIRIK
= 34364612608 (0x8004a6000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
open("/lib/libnv.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=4727585,size=91728,blksize=32768
}) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) =
34362171392 (0x800252000)
mmap(0x0,102400,PROT_NONE,MAP_GUARD,-1,0x0) = 34366881792
(0x8006d0000)
mmap(0x8006d0000,40960,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0)
Post by Özkan KIRIK
= 34366881792 (0x8006d0000)
mmap(0x8006da000,53248,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x9000)
Post by Özkan KIRIK
= 34366922752 (0x8006da000)
mmap(0x8006e7000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
Post by Özkan KIRIK
= 34366976000 (0x8006e7000)
mmap(0x8006e8000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x15000)
Post by Özkan KIRIK
= 34366980096 (0x8006e8000) munmap(0x800252000,4096) = 0 (0x0)
close(3) = 0 (0x0)
mprotect(0x800283000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002a1000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002aa000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002b2000,4096,PROT_READ) = 0 (0x0)
mprotect(0x8002bc000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
mprotect(0x8006e7000,4096,PROT_READ) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ|PROT_WRITE) = 0 (0x0)
mprotect(0x800495000,40960,PROT_READ) = 0 (0x0)
readlink("/etc/malloc.conf",0x7fffffffd600,1024) ERR#2 'No such
file or directory'
issetugid() = 0 (0x0)
__sysctl("vm.overcommit",2,0x7fffffffbb94,0x7fffffffbb88,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
Post by Özkan KIRIK
= 34368126976 (0x800800000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0)
Post by Özkan KIRIK
= 34370224128 (0x800a00000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0)
Post by Özkan KIRIK
= 34372321280 (0x800c00000) mprotect(0x210000,4096,PROT_READ) = 0
(0x0) socketpair(0x1,0x20000001,0x0,0x7fffffffba98) = 0 (0x0)
pdfork(0x7fffffffba94,0x0) = 1477 (0x5c5)
close(4) = 0 (0x0)
fcntl(3,F_GETFL,) = 6 (0x6)
fcntl(5,F_GETFL,) = 2 (0x2)
select(4,0x0,{ 3 },0x0,0x0) = 1 (0x1)
sendto(3,"l\0\0\0\0\0\0\0\0\0\0B\0\0\0\0\0"...,85,0,NULL,0) = 85
(0x55) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"l\0\0\^A\0\0\0\0\0\0\0h\0\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(3,"\^F\a\0\b\0\0\0\0\0\0\0\0\0\0\0"...,104,0,NULL,0x0) =
104 (0x68) select(4,{ 3 },0x0,0x0,0x0) = 1 (0x1)
recvmsg(3,{NULL,0,[{"\0",1}],1,{{level=SOL_SOCKET,type=SCM_RIGHTS,data={0x04,0x00,0x00,0x00}}},24,0x40000},0x40000)
Post by Özkan KIRIK
= 1 (0x1)
fcntl(4,F_GETFL,) = 6 (0x6)
close(5) = 0 (0x0)
close(3) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0;\0\0\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^A\a\0\0\0\0\0\0\0\0\0\0\0\0\0"...,59,0,NULL,0x0) =
59 (0x3b) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187
(0xbb) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) =
33 (0x21) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0z\0\0\0\0\0\0\0\0\0\0\0\0"...,168,0,NULL,0x0)
= 168 (0xa8)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,222,0,NULL,0) = 222
(0xde) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) =
33 (0x21) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-}\0\0\0"...,272,0,NULL,0) = 272
(0x110) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0]\^A\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\^E\0001\^A\0\0\0\0\0\0\0\0\0"...,349,0,NULL,0x0)
= 349 (0x15d)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 3 (0x3)
socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6) = 5 (0x5)
getuid() = 0 (0x0)
seteuid(0x0) = 0 (0x0)
getuid() = 0 (0x0)
setuid(0x0) = 0 (0x0)
getpid() = 1476 (0x5c4)
mmap(0x0,1112,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) =
34362171392 (0x800252000)
minherit(0x800252000,1112,INHERIT_ZERO) = 0 (0x0)
getrandom("m\M^X\^U\M-I\M^XP\M-e^\M-R\^UE"...,40,0) = 40 (0x28)
setsockopt(3,IPPROTO_IPV6,IPV6_USE_MIN_MTU,0x7fffffffe944,4) = 0
(0x0) setsockopt(5,IPPROTO_ICMPV6,18,0x7fffffffbad0,32) = 0 (0x0)
select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,52,0,NULL,0) = 52
(0x34) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0\M-K\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^E\a\0\M^]\0\0\0\0\0\0\0\0\0\0"...,203,0,NULL,0x0) =
203 (0xcb) select(5,0x0,{ 4 },0x0,0x0) = 1 (0x1)
sendto(4,"l\0\0\0\0\0\0\0\0\0\0\M-(\0\0\0"...,187,0,NULL,0) = 187
(0xbb) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"l\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0"...,19,0,NULL,0x0) =
19 (0x13) select(5,{ 4 },0x0,0x0,0x0) = 1 (0x1)
recvfrom(4,"\^C\^F\0\b\0\0\0\0\0\0\0\0\0\0\0"...,33,0,NULL,0x0) =
33 (0x21) socket(PF_INET6,SOCK_DGRAM,0) = 6 (0x6)
connect(6,{ AF_INET6 [2a00:1450:4006:802::2004]:10101 },28)
ERR#65 'No route to host'
ping: write(2,"ping: ",6) = 6 (0x6)
UDP connectwrite(2,"UDP connect",11) = 11 (0xb)
: write(2,": ",2) = 2 (0x2)
fstatat(AT_FDCWD,"/usr/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/share/nls/libc/C",0x7fffffffb7f0,0x0) ERR#2
'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/C/libc.cat",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/libc/C",0x7fffffffb7f0,0x0)
ERR#2 'No such file or directory'
No route to host
write(2,"No route to host\n",17) = 17 (0x11)
exit(0x1)
process exit, rval = 1
Post by Michael Gmelin
On Sun, 11 Apr 2021 07:42:23 +0300
Post by Özkan KIRIK
Hello,
ping: UDP connect: No route to host
PING www.google.com (216.58.212.100): 56 data bytes
64 bytes from 216.58.212.100: icmp_seq=0 ttl=128 time=85.487
ms 64 bytes from 216.58.212.100: icmp_seq=1 ttl=128
time=90.243 ms
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.487/87.865/90.243/2.378 ms
That's interesting - ping6 was merged into ping last year, the
https://cgit.freebsd.org/src/tree/sbin/ping/main.c#n128
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.
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
Post by Özkan KIRIK
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to
--
Michael Gmelin
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to
--
Michael Gmelin
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-net
--
Michael Gmelin
Michael Gmelin
2021-04-12 19:20:16 UTC
Permalink
On Mon, 12 Apr 2021 19:57:40 +0200
Post by Michael Gmelin
On Mon, 12 Apr 2021 17:45:36 +0300
Post by Özkan KIRIK
devfs_ruleset=0 enforce_statfs=2 host=new ip4=inherit ip6=inherit
jid=2 name=client osreldate=1300139 osrelease=13.0-RC5 path=/
persist securelevel=-1 sysvmsg=disable sysvsem=disable
sysvshm=disable vnet=new allow.nochflags allow.nomlock allow.nomount
allow.mount.nodevfs allow.mount.noprocfs allow.mount.notmpfs
allow.noquotas allow.noraw_sockets allow.noread_msgbuf
allow.reserved_ports allow.set_hostname allow.nosocket_af
allow.suser allow.nosysvipc allow.unprivileged_proc_debug
children.max=0 host.domainname="" host.hostid=0 host.hostname=""
host.hostuuid=00000000-0000-0000-0000-000000000000
I can reproduce the issue now, I'll try to dig deeper into it.
-m
[...snipsnap...]
Hi Özkan,

This is caused by ping using getaddrinfo to determine the address
family to be used. You can check this by running

getaddrinfo www.google.com

inside and outside of your jail and compare the results.

Inside your jail, inet6 entries are on top, while on your host, inet
entries are on top.

Configuration of address selection is done using /etc/rc.d/ip6addrctl,
which is enabled by default using a policy of AUTO (see
/etc/defaults/rc.conf).

As your simple jail doesn't call any rc scripts, your missing this step.

The easiest way to workaround the issue is to explicitly call:

service ip6addrctl start

after creating your vnet jail, or creating your vnet jail using:

jail -c name=client persist vnet vnet.interface=em1 \
exec.start="service ip6addrctl start"

Best,
Michael
--
Michael Gmelin
Özkan KIRIK
2021-04-27 13:56:49 UTC
Permalink
Hello Michael,

Sorry for late reply. It works after starting ip6addrctl service.
Thank you.
Post by Michael Gmelin
On Mon, 12 Apr 2021 19:57:40 +0200
Post by Michael Gmelin
On Mon, 12 Apr 2021 17:45:36 +0300
Post by Özkan KIRIK
devfs_ruleset=0 enforce_statfs=2 host=new ip4=inherit ip6=inherit
jid=2 name=client osreldate=1300139 osrelease=13.0-RC5 path=/
persist securelevel=-1 sysvmsg=disable sysvsem=disable
sysvshm=disable vnet=new allow.nochflags allow.nomlock allow.nomount
allow.mount.nodevfs allow.mount.noprocfs allow.mount.notmpfs
allow.noquotas allow.noraw_sockets allow.noread_msgbuf
allow.reserved_ports allow.set_hostname allow.nosocket_af
allow.suser allow.nosysvipc allow.unprivileged_proc_debug
children.max=0 host.domainname="" host.hostid=0 host.hostname=""
host.hostuuid=00000000-0000-0000-0000-000000000000
I can reproduce the issue now, I'll try to dig deeper into it.
-m
[...snipsnap...]
Hi Özkan,
This is caused by ping using getaddrinfo to determine the address
family to be used. You can check this by running
getaddrinfo www.google.com
inside and outside of your jail and compare the results.
Inside your jail, inet6 entries are on top, while on your host, inet
entries are on top.
Configuration of address selection is done using /etc/rc.d/ip6addrctl,
which is enabled by default using a policy of AUTO (see
/etc/defaults/rc.conf).
As your simple jail doesn't call any rc scripts, your missing this step.
service ip6addrctl start
jail -c name=client persist vnet vnet.interface=em1 \
exec.start="service ip6addrctl start"
Best,
Michael
--
Michael Gmelin
Loading...