]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: mctp: add gateway routing support
authorJeremy Kerr <jk@codeconstruct.com.au>
Wed, 2 Jul 2025 06:20:13 +0000 (14:20 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 8 Jul 2025 10:39:24 +0000 (12:39 +0200)
commitad39c12fcee34b8980a80ad5c803bca9906fbd4e
tree04175b4b2a82e46cccb30145637c3677e7de710f
parent28ddbb2abe13776d3835f4bda535edd46336870a
net: mctp: add gateway routing support

This change allows for gateway routing, where a route table entry
may reference a routable endpoint (by network and EID), instead of
routing directly to a netdevice.

We add support for a RTM_GATEWAY attribute for netlink route updates,
with an attribute format of:

    struct mctp_fq_addr {
        unsigned int net;
        mctp_eid_t eid;
    }

- we need the net here to uniquely identify the target EID, as we no
longer have the device reference directly (which would provide the net
id in the case of direct routes).

This makes route lookups recursive, as a route lookup that returns a
gateway route must be resolved into a direct route (ie, to a device)
eventually. We provide a limit to the route lookups, to prevent infinite
loop routing.

The route lookup populates a new 'nexthop' field in the dst structure,
which now specifies the key for the neighbour table lookup on device
output, rather than using the packet destination address directly.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://patch.msgid.link/20250702-dev-forwarding-v5-13-1468191da8a4@codeconstruct.com.au
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/mctp.h
include/uapi/linux/mctp.h
net/mctp/route.c
net/mctp/test/utils.c