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=BGLIic8v; 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 26AAC5A0008 for ; Thu, 27 Mar 2025 05:43:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743050635; 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=IXAQ593+v+X127x3Z0e5RT4BxnA37gHR+PpDJhrIZw8=; b=BGLIic8vPo2SwE/ExQHivxe/qS+rQrTXV8oelcC/8yboFpD7s22BdtgvnhfXHdJ+8eFTEB LeEKcAHIcnW3HfMk4FMK/UAp9Bnau89dVBoRRM4WCCsy1jyiLALzdLxPtl3xQqs9lq//iQ QsZTSYXZWlpXctL54QIS3oBUxm0AWJU= 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-133-sI7bBVIBOw2YZJFT_SOIdQ-1; Thu, 27 Mar 2025 00:43:53 -0400 X-MC-Unique: sI7bBVIBOw2YZJFT_SOIdQ-1 X-Mimecast-MFC-AGG-ID: sI7bBVIBOw2YZJFT_SOIdQ_1743050633 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3913aaf1e32so253059f8f.0 for ; Wed, 26 Mar 2025 21:43:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743050632; x=1743655432; 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=IXAQ593+v+X127x3Z0e5RT4BxnA37gHR+PpDJhrIZw8=; b=b8cfFS5EWYQVT0/KIQYBKuCu+0MV1JyVaNpuVmUYF2aKV7bUqZydCzIWPyJhyZd4DO BdYP82df3L0ti/oUpCuxiKOZwQqTwy2dVUu7lsSkU4Al28idaQFVq8KTGkRj/UZNmj9T m/I4mWTAMisPzuoO58Oussjco5/XJZg5Ns/IW9SAbs3AzMqhKPqZ1gCsONaNpHX2IL3r Vljw+/CXlQDIADoX7eSP/KCcxkkE+p8xcexutVThPlfc3k1+x8nIt+4foFYqQC70Zeor eNnwbtB6FQqv6NZk5SjFI6WH7snCoVOG6M583ZkXC/IOfbAoJZGyEutK//xKf4qa/mJp /hXg== X-Gm-Message-State: AOJu0YxZ4W0cK4o2UABCmMv/27PQekofZrbj71GYQ5esLq7JgRIUlNPh T6a4ZYTEZdXb6eo41o8gdhAKbwxQgBD++loGxO9YxrZ9lbyfPdyJrucLqbIf29NZrVzPXXCtyiW ObTitz3i30RVzzBxbOcL0EjZFpf0m2Svj51yM8CwhnJDvsb2OUrxd4UO5QdV9C5RXL6lrbQcV95 n+emmmNPEpLpP0QtF9sqkcV9LWTnWulTDiFaU= X-Gm-Gg: ASbGncsUPONZuVt5BnvnUmo79QntJ6PJKAQUnrEHcddukvNS/n5ZbrSUckGqbq/xECT 8JzS3nIrFY3/yu8vriavHMQ0JEYfE1KWSJiWih5DEDGOrHVjy8yXBhAWy0lu2msMhUYT7QCzrZa 1dTbnFtCo5SLiBcavdai0px8x1adCNAweeR1Mkb/C4mdkPcfXmkTG73H7TxHfMVWG4Wqv4GN+rY zdDOHUjSuBMmqhWUt9YlhpNNRtptZZkiRP02XUxBcPAtF8LuKp50daMg3+gwGeZU/Xl7wohety2 HlD6JJ7Yuhw6H99xD3W3M5NIlR4= X-Received: by 2002:a05:6000:4211:b0:391:12a5:3cb3 with SMTP id ffacd0b85a97d-39ad173d283mr1486308f8f.3.1743050632047; Wed, 26 Mar 2025 21:43:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6LTlDecP+62NEvIy7EIicPibiq/F31iY4XI1Dy8miCr4Nftmr5Exq6EPH+4qgqiZQzqw/jA== X-Received: by 2002:a05:6000:4211:b0:391:12a5:3cb3 with SMTP id ffacd0b85a97d-39ad173d283mr1486237f8f.3.1743050630530; Wed, 26 Mar 2025 21:43:50 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9b5b8dsm18934213f8f.59.2025.03.26.21.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Mar 2025 21:43:50 -0700 (PDT) Date: Thu, 27 Mar 2025 05:43:47 +0100 From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v2] udp: correct source address for ICMP messages Message-ID: <20250327054347.33f22788@elisabeth> In-Reply-To: <20250326155902.2903258-1-jmaloy@redhat.com> References: <20250326155902.2903258-1-jmaloy@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8U9brRq117IxRThqYzL7IGq3sMHeDjOwVH89BD8AKOk_1743050633 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 2E2JJMJBPCTLAZVQMLQJCBBWWUAGCLY6 X-Message-ID-Hash: 2E2JJMJBPCTLAZVQMLQJCBBWWUAGCLY6 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, lvivier@redhat.com, dgibson@redhat.com 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 Wed, 26 Mar 2025 11:59:02 -0400 Jon Maloy wrote: > While developing traceroute forwarding tap-to-sock we found that > struct msghdr.msg_name for the ICMPs in the opposite direction always > contains the destination address of the original UDP message, and not, > as one might expect, the one of the host which created the error message. > > Study of the kernel code reveals that this address instead is appended > as extra data after the received struct sock_extended_err area. > > We now change the ICMP receive code accordingly. > > Fixes: 55431f0077b6 ("udp: create and send ICMPv4 to local peer when applicable") > Fixes: 68b04182e07d ("udp: create and send ICMPv6 to local peer when applicable") > > Signed-off-by: Jon Maloy > --- > v2: Removed stray comment and unecessary initializations, as per > feedback from David Gibson Applied. -- Stefano