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=QApThz7W; 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 B113B5A0271 for ; Wed, 20 Aug 2025 05:10:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755659412; 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=fEfAKWePZQ60DmibP2kCbqk0iFVnXzo7vPdg4tHa6w0=; b=QApThz7WeX+uX9GRYdo5pCTtR1prD0qWPRNkaVycEqtvgzng0V3aiHRiiX09TxnbIdV8Kj SeuG7XUBSHGXPuEXn183pJdzmbmJ0+6EnYQqU0QEYRB/Genz2foru95oL000gJQ93S+cfU YRPbzjMWhzQucTyaOWqKERyQcfaiIGY= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-IbdFuFaNNa6aukPJW9NTCQ-1; Tue, 19 Aug 2025 23:10:09 -0400 X-MC-Unique: IbdFuFaNNa6aukPJW9NTCQ-1 X-Mimecast-MFC-AGG-ID: IbdFuFaNNa6aukPJW9NTCQ_1755659408 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A20EE1800446; Wed, 20 Aug 2025 03:10:07 +0000 (UTC) Received: from jmaloy-thinkpadp16vgen1.rmtcaqc.csb (unknown [10.22.88.50]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D695C19A4C99; Wed, 20 Aug 2025 03:10:05 +0000 (UTC) From: Jon Maloy To: sbrivio@redhat.com, dgibson@redhat.com, david@gibson.dropbear.id.au, jmaloy@redhat.com, passt-dev@passt.top Subject: [PATCH v4 0/9] Use true MAC address of LAN local remote hosts Date: Tue, 19 Aug 2025 23:09:56 -0400 Message-ID: <20250820031005.2725591-1-jmaloy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: u6VO1LhGQ5BfY63mhlka1YrWGIMIS8s6lXuaj001RTo_1755659408 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: 2RJJPG24CDCHG22WFGTIWAFOI2BC72MQ X-Message-ID-Hash: 2RJJPG24CDCHG22WFGTIWAFOI2BC72MQ 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: Bug #120 asks us to use the true MAC addresses of LAN local remote hosts, since some programs need this information. These commits introduces this for ARP, NDP, UDP, TCP and ICMP. --- v3: Updated according to feedback from Stefano and David: - Made the ARP/NDP lookup call filter out the requested address by itself, qualified by the index if the template interface - Moved the flow specific MAC address from struct flowside to struct flow_common. v4: - Updated according to feedback from David and Stefan - Added a cache table for ARP/NDP table contents Jon Maloy (9): netlink: add function to extract MAC addresses from NDP/ARP table arp/ndp: respond with true MAC address of LAN local remote hosts flow: add MAC address of LAN local remote hosts to flow udp: forward external source MAC address through tap interface tcp: forward external source MAC address through tap interface tap: change signature of function tap_push_l2h() tcp: make tcp_rst_no_conn() respond with correct MAC address icmp: let icmp use mac address from flowside structure fwd: Added cache table for ARP/NDP contents arp.c | 8 ++ conf.c | 2 + flow.c | 20 +++- flow.h | 2 + fwd.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++-- fwd.h | 5 + icmp.c | 4 +- inany.c | 1 + ndp.c | 10 +- netlink.c | 79 ++++++++++++++++ netlink.h | 2 + passt.c | 9 +- passt.h | 3 +- pasta.c | 2 +- tap.c | 23 +++-- tap.h | 7 +- tcp.c | 21 ++++- tcp.h | 2 +- tcp_buf.c | 29 +++--- tcp_internal.h | 2 +- tcp_vu.c | 5 +- udp.c | 52 ++++++----- udp.h | 2 +- 23 files changed, 452 insertions(+), 82 deletions(-) -- 2.50.1