Re: [PATCH net-next v2 1/3] net: nexthop: add NHA_FDB_PORT for fdb nexthops

From: Jack Ma

Date: Tue Jul 21 2026 - 18:30:54 EST


On Tue, Jul 21, 2026 at 06:17:41PM +0300, Ido Schimmel wrote:
> Maybe NLA_POLICY_MIN(NLA_BE16, 1) given that it's BE16 and that we don't
> dump / use a destination port of 0?

Done for v3. Switched the NHA_FDB_PORT policy to
NLA_POLICY_MIN(NLA_BE16, 1), so the core rejects a zero destination
port for us; the "fdb + gateway" requirement stays in
rtm_to_nh_config().

> Why not nhi->fdb_port ?

Good catch. Fixed for v3: nh_nlmsg_size_single() now reserves the
NHA_FDB_PORT space under "if (nhi->fdb_port)", matching the emit
condition in nh_fill_node() so the size calculation and the dump
agree and space is only reserved when a port is actually set.

Thanks,
Jack