public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Jon Maloy <jmaloy@redhat.com>, dgibson@redhat.com, passt-dev@passt.top
Subject: Re: [PATCH v2 1/8] netlink: Add function to extract mac addresses from arp table
Date: Fri, 13 Jun 2025 16:11:06 +1000	[thread overview]
Message-ID: <aEvA-kvbp5b8IUFu@zatzit> (raw)
In-Reply-To: <20250612171705.0594ffa4@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

On Thu, Jun 12, 2025 at 05:17:05PM +0200, Stefano Brivio wrote:
> On Thu, 12 Jun 2025 00:21:45 -0400
> Jon Maloy <jmaloy@redhat.com> wrote:
> 
> > The solution to bug #120 requires the ability to translate from
> > an IP address to its corresponding MAC address in cases where
> > those are present in the ARP/NTP table.
> 
> Nit: NDP.
> 
> > We add this feature here.
> > 
> > Signed-off-by: Jon Maloy <jmaloy@redhat.com>
> 
> Nit: David's address is david@gibson.dropbear.id.au (in case you need
> to Cc: him specifically).

Yes, thanks.

[snip]
> > +	if (IN6_IS_ADDR_V4MAPPED(&addr->a6)) {

inany_v4() exists for exactly this sort of case.  It will both test if
the address is a v4 address, and extract it if so, so you shouldn't
need to poke into the innards of union inany_addr.

> > +		ip = &addr->v4mapped.a4;
> > +		alen = sizeof(struct in_addr);
> > +		req.ndm.ndm_family = AF_INET;
> > +	} else {
> > +		ip = &addr->a6;
> > +		alen = sizeof(struct in6_addr);
> > +		req.ndm.ndm_family = AF_INET6;
> > +	}

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-06-13  6:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12  4:21 [PATCH v2 0/8] use true mac address of LAN local remote hosts Jon Maloy
2025-06-12  4:21 ` [PATCH v2 1/8] netlink: Add function to extract mac addresses from arp table Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-13  6:11     ` David Gibson [this message]
2025-06-12  4:21 ` [PATCH v2 2/8] arp: respond with true mac address of LAN local remote hosts Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-12  4:21 ` [PATCH v2 3/8] flow: add mac address of LAN local remote hosts to flow Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-14 13:22     ` David Gibson
2025-06-12  4:21 ` [PATCH v2 4/8] udp: forward external source mac address through tap interface Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-12  4:21 ` [PATCH v2 5/8] tcp: " Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-12  4:21 ` [PATCH v2 6/8] tap: change signature of function tap_push_l2h() Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-12  4:21 ` [PATCH v2 7/8] tcp: make tcp_rst_no_conn() respond with correct mac address Jon Maloy
2025-06-12 15:17   ` Stefano Brivio
2025-06-12  4:21 ` [PATCH v2 8/8] icmp: let icmp use mac address from flowside structure Jon Maloy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aEvA-kvbp5b8IUFu@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=dgibson@redhat.com \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).