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=UAdHcvUB; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 723D35A026F for ; Thu, 24 Apr 2025 04:52:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1745463152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RCH0lFG5jBHqMby+YdX8FkMfdjF6zB2cMDcExgmq5DA=; b=UAdHcvUBGyAeeGwy/Ch9G2B7qkmQL3LVdAU+d9ew2w0S0zTZBijelOIjiU1iEsaDKK9FJX 8hWH5wIYcpelrShRfW4JcW7Yj7Znc+RHve7Of3THGjvqKNJeaocz9X3hjQHWIBAWUwyMb3 DMYIDmiwcGJaS394giELmvHr6Yvusv8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-p7zRCR3wNzSSY7gk6Y0efg-1; Wed, 23 Apr 2025 22:52:30 -0400 X-MC-Unique: p7zRCR3wNzSSY7gk6Y0efg-1 X-Mimecast-MFC-AGG-ID: p7zRCR3wNzSSY7gk6Y0efg_1745463149 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 906D01955DCC for ; Thu, 24 Apr 2025 02:52:29 +0000 (UTC) Received: from jmaloy-thinkpadp16vgen1.rmtcaqc.csb (unknown [10.22.64.34]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0194F180047F; Thu, 24 Apr 2025 02:52:27 +0000 (UTC) From: Jon Maloy To: sbrivio@redhat.com, dgibson@redhat.com, jmaloy@redhat.com, passt-dev@passt.top Subject: [PATCH 0/2] udp: copy ttl or hop limit from socket to tap Date: Wed, 23 Apr 2025 22:52:25 -0400 Message-ID: <20250424025227.61697-1-jmaloy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 34Mgx7753-f-lWCK0eTKlOdXeHjTHx3fGPVnSG1iLuk_1745463149 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: ZCNM7FZWE2YR3RLIPQGLRXENYCMIAFBM X-Message-ID-Hash: ZCNM7FZWE2YR3RLIPQGLRXENYCMIAFBM X-MailFrom: jmaloy@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 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: The following patches were meant as a preparation for supporting traceroute from remote to internal peers. Unfortunately we ran into two showstoppers during this work. 1: We cannot read IPv4 ttl from the dual-stack socket we are using as listener. setsockopt(IP_RECVTTL) is simply not supported by the kernel for IPv6 socket, even in dual-stack mode. It is not acceptable from a memory consumption viewpoint to create two listener sockets, one for IPv4 and one for IPv6, for each bound port. 2: There is no way we can create and send ICMP response messages to be sent out from the outgoing socket unless we can access it with privileges, which we cannot in PASST. Because of this, these patches are posted mostly as a documentation of the work done, maybe to be applied some time in the future if new conditions permit. Jon Maloy (2): make ttl parametrized udp: copy incoming packet TTL from socket to tap checksum.c | 7 +++-- checksum.h | 2 +- ip.h | 11 ++++--- tap.c | 16 +++++----- tap.h | 6 ++-- tcp.c | 5 ++-- udp.c | 79 +++++++++++++++++++++++++++++++++++++------------- udp_flow.c | 18 ++++++++++++ udp_internal.h | 4 +-- udp_vu.c | 5 ++-- util.c | 5 ++++ 11 files changed, 112 insertions(+), 46 deletions(-) -- 2.48.1