From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id AC8375A026D for ; Sun, 28 May 2023 16:38:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685284697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XoV5J4mUDo+brUGYs3nOyAr3wB/+Kdn5AB+yseAwPPU=; b=BngSbDwhTFxZf7EUZbXVqt96GDl1irbds/OzkzgVgrZPr6MSY721OIgYydFpEv11DT8sf4 Q19nRfjufA3L5CB/YFRrJ61xLYcH35pk0YxNy0ZvalM1R1k/H+GduV16HzwCMHlddOAhmN eNplOe71gvnfmYvP3f1bB+IFc2PZI2U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-gi2rYRtNONqBY1iahBrGUw-1; Sun, 28 May 2023 10:38:15 -0400 X-MC-Unique: gi2rYRtNONqBY1iahBrGUw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F8D1811E78; Sun, 28 May 2023 14:38:15 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0D4040CF8EE; Sun, 28 May 2023 14:38:14 +0000 (UTC) Date: Sun, 28 May 2023 16:38:12 +0200 From: Stefano Brivio To: Juan Orti Subject: Re: IPv6 UDP not working Message-ID: <20230528163812.69e359dd@elisabeth> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MCKDK7FQYOARLM7YCCTMFUIGZQQH6IKZ X-Message-ID-Hash: MCKDK7FQYOARLM7YCCTMFUIGZQQH6IKZ X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson , "passt-user@passt.top" X-Mailman-Version: 3.3.8 Precedence: list List-Id: "For users: support, questions and answers" Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Sun, 28 May 2023 10:50:20 +0000 Juan Orti wrote: > ------- Original Message ------- > El domingo, 28 de mayo de 2023 a las 12:12, Juan Orti escri= bi=C3=B3: >=20 > > I don't understand why it's not working, as the service listens on the = :: address. Maybe it's using a socket option that it's causing this? I need= to investigate this further. > >=20 > > # netstat -putan > > Active Internet connections (servers and established) > > Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nam= e > > tcp 0 0 :::3003 :::* LISTEN 2/AdGuardHome > > tcp 0 0 :::54 :::* LISTEN 2/AdGuardHome > > udp 0 0 :::54 :::* 2/AdGuardHome > >=20 > > # cat /proc/net/udp6 > > sl local_address remote_address st tx_queue rx_queue tr tm->when retrns= mt uid timeout inode ref pointer drops > >=20 > > 4718: 00000000000000000000000000000000:0036 000000000000000000000000000= 00000:0000 07 00000000:00000000 00:00000000 00000000 0 0 38510801 2 0000000= 073476783 0 =20 >=20 > After stracing the AdGuardHome process, I can see that the UDP packet is = indeed reaching the service but it's the reply that fails to be sent: >=20 > 11 10:25:04.445902 recvmsg(25, > 11 10:25:04.446238 <... recvmsg resumed>{msg_name=3D{sa_family=3DAF_IN= ET6, sin6_port=3Dhtons(33308), sin6_flowinfo=3Dhtonl(0), inet_pton(AF_INET6= , "fddc:f797:78ef:10::b46", &sin6_addr), sin6_scope_id=3D0}, msg_namelen=3D= 112 =3D> 28, msg_iov=3D[{iov_base=3D"\246\245\1 \0\1\0\0\0\0\0\1\3www\6goog= le\3com\0\0\1\0\1\0\0)\4\320\0\0\0\0\0\f\0\n\0\10\207a\315\224\245\253\v\37= ", iov_len=3D65535}], msg_iovlen=3D1, msg_control=3D[{cmsg_len=3D36, cmsg_l= evel=3DSOL_IPV6, cmsg_type=3D0x32}], msg_controllen=3D40, msg_flags=3D0}, 0= ) =3D 55 <0.000059> > 11 10:25:04.446371 futex(0xc000064548, FUTEX_WAKE_PRIVATE, 1 > 11 10:25:04.446415 <... futex resumed>) =3D 1 <0.000032> > 11 10:25:04.446461 recvmsg(25, > 11 10:25:04.446658 <... recvmsg resumed>{msg_namelen=3D112}, 0) =3D -1= EAGAIN (Resource temporarily unavailable) <0.000097> > 11 10:25:04.447130 sendmsg(25, {msg_name=3D{sa_famil= y=3DAF_INET6, sin6_port=3Dhtons(33308), sin6_flowinfo=3Dhtonl(0), inet_pton= (AF_INET6, "fddc:f797:78ef:10::b46", &sin6_addr), sin6_scope_id=3D0}, msg_n= amelen=3D28, msg_iov=3D[{iov_base=3D"\246\245\201\200\0\1\0\1\0\0\0\0\3www\= 6google\3com\0\0\1\0\1\300\f\0\1\0\1\0\0\0\n\0\4\330\357&x", iov_len=3D48}]= , msg_iovlen=3D1, msg_control=3D[{cmsg_len=3D36, cmsg_level=3DSOL_IPV6, cms= g_type=3D0x32}], msg_controllen=3D40, msg_flags=3D0}, 0) =3D -1 EINVAL (Inv= alid argument) <0.000020> >=20 > It's not clear to me what's wrong with the sendmsg syscall. Any ideas? I guess that might come from the IPV6_PKTINFO ancillary data (cmsg_type 0x32) -- I'm not sure how and why it's used here as strace doesn't dump the CMSG_DATA content, but, having a look at ip6_datagram_send_ctl() (net/ipv6/datagram.c), EINVAL might come from: 1. a link-local address being passed along... I doubt that's the case 2. a non-local address (or one we can't bind to anyway) being used. To check if we're in this case, it would be helpful if you could share the addressing information from the container (ip -6 address show), and if you could try 'sysctl -w net.ipv6.ip_nonlocal_bind =3D 1', again from the container. --=20 Stefano