From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BLx4pSGA; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 3F5925A026F for ; Mon, 14 Apr 2025 11:56:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744624608; 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=jHWVuyJTDZILZtieaEYU186lqSImO5sQwia/OcrRjBA=; b=BLx4pSGAdsEIaQvHkSNMDhisggEr7a0lApqdCDDgauB4B/lTa1OM/o0K2YGUAUOWz9zNhB XGRa4Uw+jljhHfdRo5IUmBkXph9qosEMLclC0XGRc3dS/k2TJktzHCvUO2SPceUaL1vx2p ER8wFxL4AlIALYSbkGWXBEsCpUzpciQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-WV58znzgN_mpC7YUsIMkVg-1; Mon, 14 Apr 2025 05:56:46 -0400 X-MC-Unique: WV58znzgN_mpC7YUsIMkVg-1 X-Mimecast-MFC-AGG-ID: WV58znzgN_mpC7YUsIMkVg_1744624605 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-39d917b1455so1581927f8f.3 for ; Mon, 14 Apr 2025 02:56:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744624605; x=1745229405; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jHWVuyJTDZILZtieaEYU186lqSImO5sQwia/OcrRjBA=; b=qeRIa9EtjudBEcUBv672fkCFb68/QNrl1I3l2R7DqqrLaQ5zM14JLR1JMhX8ztpIO1 WalvhAr6q9WHqVUdNu2ivhHilRkQ0IsBNFk6LOcKiFv2UgjBITvltgfq8Cnh295RiX+X xABt0+JfQT1yvTE3jFMGwwyL9r3FEtFx0ZU3Nm5WyNqWPG79J5KZfrwXJax1BZpH+0CA pUKZueNKcYidBPxh2W3ZIX2TG/1R31WNJ1GQlyllnPTPKezfPqbnNOhQ359T/rRrP15y Y+Oe3LpvaoMgbUUtB5qPwNl7bkpxeBeOR1kPGjihV3shU0cb4LTNuEqwyBx3JzStDw9f gmRQ== X-Gm-Message-State: AOJu0YyfYMs77vEt96uWRZJi9PmsZBluagXfbVW9RAg8f4zd78QYd1i6 KzVwW77MTqH528LSy/tfhrBejfGASjI6S1jkOrKy4Ez+pn2dU3H8fB6RcsGFJZVlK660jChlPCH AjGiCGJTpZDqhQZcTNeTUNyRbq+FXP1HoHgJ8/rhp3LlU3HuV+Q== X-Gm-Gg: ASbGncs9euFo1zlgjlZIhZFbuEuQ7MTsfpbnN4xj6Yk1TBvirsBM9nFGMTGVQAInrc1 FwnGX9vEWEJXXGrrNN12C3bFRgFyDZlugwWi8bKNjIQzaDgyPv8fIh8TEC7lzoRh+UUXVBe0G32 56mEDWJ87OA/nSCFA24a6ub3/vKag0hYm6L4dYJruc8MjwtnNfCNc0ZpB4wSM9VpBtFQgHtFV55 JoHSjupGRvw//eLqEKpVJ27j93tsdPetBBTWqwPCMdoZHDB4YQ6Cx2dHozAom2l/HBmpDfEbML5 gmDlXJjf4JktA5zLVg7YjMPRl+xNP5+vkaJQiGHo X-Received: by 2002:a05:6000:4201:b0:391:29c0:83f5 with SMTP id ffacd0b85a97d-39eaaebdbedmr9639371f8f.44.1744624605208; Mon, 14 Apr 2025 02:56:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsFGcgqAV8vQOYJmLHVu7Njnbk+bYqp8mHylJo9k9uFZC44kASdHHg31TM/BPv2n5s6QEv6A== X-Received: by 2002:a05:6000:4201:b0:391:29c0:83f5 with SMTP id ffacd0b85a97d-39eaaebdbedmr9639352f8f.44.1744624604743; Mon, 14 Apr 2025 02:56:44 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eae9640fdsm10406694f8f.7.2025.04.14.02.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Apr 2025 02:56:44 -0700 (PDT) Date: Mon, 14 Apr 2025 11:56:41 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] udp: Fix breakage of UDP error handling by PKTINFO support Message-ID: <20250414115641.03064d86@elisabeth> In-Reply-To: <20250414035853.1379261-1-david@gibson.dropbear.id.au> References: <20250414035853.1379261-1-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lRXRMFq4SArTRlvvhA6vqBgZj8VnIo8bYwDJiN7S0fs_1744624605 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: EO4Z3LDQU737J3735Z4VSHH46TTAJN3W X-Message-ID-Hash: EO4Z3LDQU737J3735Z4VSHH46TTAJN3W 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: passt-dev@passt.top, Jon Maloy X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 14 Apr 2025 13:58:53 +1000 David Gibson wrote: > We recently enabled the IP_PKTINFO / IPV6_RECVPKTINFO socket options on our > UDP sockets. This lets us obtain and properly handle the specific local > address used when we're "listening" with a socket on 0.0.0.0 or ::. > > However, the PKTINFO cmsgs this option generates appear on error queue > messages as well as regular datagrams. udp_sock_recverr() doesn't expect > this and so flags an unrecoverable error when it can't parse the control > message. > > Correct this by adding space in udp_sock_recverr()s control buffer for the > additional PKTINFO data, and scan through all cmsgs for the RECVERR, rather > than only looking at the first one. > > Link: https://bugs.passt.top/show_bug.cgi?id=99 > Fixes: f4b0dd8b06 ("udp: Use PKTINFO cmsgs to get destination address..") > Reported-by: Stefano Brivio > > Signed-off-by: David Gibson The patch looks good to me, but I'm hitting something in my tests (with my recent DNS fix) that's perhaps not intended. On the host: $ cat /etc/resolv.conf nameserver 127.0.0.1 ...and nobody is listening on that address. Podman passes --dns-forward 169.254.1.1 (default) and in the container: $ podman run --net=pasta:-d,-l,/tmp/pasta.log --rm -ti alpine sh I do: / # nslookup google.com 169.254.1.1 ;; connection timed out; no servers could be reached which is expected. But logs show a warning: 49.5377: Flow 0 (NEW): FREE -> NEW 49.5377: Flow 0 (INI): NEW -> INI 49.5377: Flow 0 (INI): TAP [88.198.0.164]:43458 -> [169.254.1.1]:53 => ? 49.5377: Flow 0 (TGT): INI -> TGT 49.5377: Flow 0 (TGT): TAP [88.198.0.164]:43458 -> [169.254.1.1]:53 => HOST [0.0.0.0]:43458 -> [127.0.0.1]:53 49.5377: Flow 0 (UDP flow): TGT -> TYPED 49.5377: Flow 0 (UDP flow): TAP [88.198.0.164]:43458 -> [169.254.1.1]:53 => HOST [0.0.0.0]:43458 -> [127.0.0.1]:53 49.5378: Flow 0 (UDP flow): Side 0 hash table insert: bucket: 148325 49.5378: Flow 0 (UDP flow): Side 1 hash table insert: bucket: 309967 49.5378: Flow 0 (UDP flow): TYPED -> ACTIVE 49.5378: Flow 0 (UDP flow): TAP [88.198.0.164]:43458 -> [169.254.1.1]:53 => HOST [127.0.0.1]:43458 -> [127.0.0.1]:53 49.5378: WARNING: Error peeking at socket address: Connection refused 49.5379: ICMP error on UDP socket 208: Connection refused 49.5379: ICMP error on UDP socket 208: Connection refused 52.0404: ICMP error on UDP socket 208: Connection refused 52.0404: ICMP error on UDP socket 208: Connection refused and I'm not sure if that warning is intended. By the way, I have the feeling that it now takes longer (with the whole IP_PKTINFO thing) for nslookup to fail, as if those ICMP errors were not relayed anymore, but I'm not sure about this, and I didn't investigate yet. -- Stefano