Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Invalid
-
Fix Version/s: OpenVZ-legacy
-
Component/s: Containers::Kernel
-
Security Level: Public
-
Environment:kernel 2.6.32-042stab112.15
Description
>Description of problem:
Sometimes tcp packets lose on loopback.
nc listen port 4534, but accept() is sleep and not return!
I run tcpdump and see packets from telnet to nc, but not from nc to telnet.
Container restart does not solve problem.
>Steps to Reproduce:
# strace nc -l 127.0.0.1 4534
....
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(4534), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
listen(3, 1) = 0
accept(3,
(in other session)
# telnet 127.0.0.1 4534
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection timed out
(in other session)
12:27:16.380522 IP localhost.localdomain.61060 > localhost.localdomain.4534: Flags [S], seq 2170016745, win 65483, options [mss 65495,sackOK,TS val 1048118367 ecr 1218379606,nop,wscale 8], length 0
12:27:17.379498 IP localhost.localdomain.61060 > localhost.localdomain.4534: Flags [S], seq 2170016745, win 65483, options [mss 65495,sackOK,TS val 1048119367 ecr 1218379606,nop,wscale 8], length 0
12:27:19.379492 IP localhost.localdomain.61060 > localhost.localdomain.4534: Flags [S], seq 2170016745, win 65483, options [mss 65495,sackOK,TS val 1048121367 ecr 1218379606,nop,wscale 8], length 0
>Expected results:
Established connection to 127.0.0.1
>Host OS:
CentOS release 6.7 (Final)
>Guest OS:
CentOS release 6.7 (Final)
>Additional info (see https://openvz.org/Reporting_OpenVZ_problem):
No any related info in dmesg.
kernel RPM from openvz.org
vzkernel-2.6.32-042stab112.15.x86_64
vzctl version 4.9.4
container config:
PHYSPAGES="16777216"
SWAPPAGES="0:512M"
DISKSPACE="209715200:209715200"
DISKINODES="10485760:10485760"
QUOTATIME="0"
CPUUNITS="1000"
NETFILTER="stateless"
IP_ADDRESS="10.10.10.57"
HOSTNAME="cdb"
VE_ROOT="/vz/root/$VEID"
VE_PRIVATE="/vz/private/$VEID"
VE_LAYOUT="simfs"
OSTEMPLATE="centos-6-x86_64-minimal"
ORIGIN_SAMPLE="vswap-256m"
/etc/vz/vz.conf
VIRTUOZZO=yes
LOCKDIR=/vz/lock
DUMPDIR=/vz/dump
VE0CPUUNITS=1000
VE_STOP_MODE=suspend
LOGGING=yes
LOGFILE=/var/log/vzctl.log
LOG_LEVEL=0
VERBOSE=0
DISK_QUOTA=yes
VZFASTBOOT=no
MODULES_DISABLED=no
ERROR_ON_ARPFAIL="no"
TEMPLATE=/vz/template
VE_ROOT=/vz/root/$VEID
VE_PRIVATE=/vz/private/$VEID
CONFIGFILE="vswap-256m"
DEF_OSTEMPLATE="centos-6-x86"
VE_LAYOUT=ploop
LOCAL_UID=100000
LOCAL_GID=100000
VZWDOG="no"
IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length"
IPV6="no"
SKIP_SYSCTL_SETUP=yes
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet 127.0.0.1/32 scope host venet0
inet 10.10.1.57/32 brd 10.10.1.57 scope global venet0:0
# ip r
169.254.0.0/16 dev venet0 scope link metric 1002
default dev venet0 scope link
Sometimes tcp packets lose on loopback.
nc listen port 4534, but accept() is sleep and not return!
I run tcpdump and see packets from telnet to nc, but not from nc to telnet.
Container restart does not solve problem.
>Steps to Reproduce:
# strace nc -l 127.0.0.1 4534
....
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(4534), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
listen(3, 1) = 0
accept(3,
(in other session)
# telnet 127.0.0.1 4534
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection timed out
(in other session)
12:27:16.380522 IP localhost.localdomain.61060 > localhost.localdomain.4534: Flags [S], seq 2170016745, win 65483, options [mss 65495,sackOK,TS val 1048118367 ecr 1218379606,nop,wscale 8], length 0
12:27:17.379498 IP localhost.localdomain.61060 > localhost.localdomain.4534: Flags [S], seq 2170016745, win 65483, options [mss 65495,sackOK,TS val 1048119367 ecr 1218379606,nop,wscale 8], length 0
12:27:19.379492 IP localhost.localdomain.61060 > localhost.localdomain.4534: Flags [S], seq 2170016745, win 65483, options [mss 65495,sackOK,TS val 1048121367 ecr 1218379606,nop,wscale 8], length 0
>Expected results:
Established connection to 127.0.0.1
>Host OS:
CentOS release 6.7 (Final)
>Guest OS:
CentOS release 6.7 (Final)
>Additional info (see https://openvz.org/Reporting_OpenVZ_problem):
No any related info in dmesg.
kernel RPM from openvz.org
vzkernel-2.6.32-042stab112.15.x86_64
vzctl version 4.9.4
container config:
PHYSPAGES="16777216"
SWAPPAGES="0:512M"
DISKSPACE="209715200:209715200"
DISKINODES="10485760:10485760"
QUOTATIME="0"
CPUUNITS="1000"
NETFILTER="stateless"
IP_ADDRESS="10.10.10.57"
HOSTNAME="cdb"
VE_ROOT="/vz/root/$VEID"
VE_PRIVATE="/vz/private/$VEID"
VE_LAYOUT="simfs"
OSTEMPLATE="centos-6-x86_64-minimal"
ORIGIN_SAMPLE="vswap-256m"
/etc/vz/vz.conf
VIRTUOZZO=yes
LOCKDIR=/vz/lock
DUMPDIR=/vz/dump
VE0CPUUNITS=1000
VE_STOP_MODE=suspend
LOGGING=yes
LOGFILE=/var/log/vzctl.log
LOG_LEVEL=0
VERBOSE=0
DISK_QUOTA=yes
VZFASTBOOT=no
MODULES_DISABLED=no
ERROR_ON_ARPFAIL="no"
TEMPLATE=/vz/template
VE_ROOT=/vz/root/$VEID
VE_PRIVATE=/vz/private/$VEID
CONFIGFILE="vswap-256m"
DEF_OSTEMPLATE="centos-6-x86"
VE_LAYOUT=ploop
LOCAL_UID=100000
LOCAL_GID=100000
VZWDOG="no"
IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length"
IPV6="no"
SKIP_SYSCTL_SETUP=yes
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet 127.0.0.1/32 scope host venet0
inet 10.10.1.57/32 brd 10.10.1.57 scope global venet0:0
# ip r
169.254.0.0/16 dev venet0 scope link metric 1002
default dev venet0 scope link