mctp: Specify route types, require rtm_type in RTM_*ROUTE messages

This change adds a 'type' attribute to routes, which can be parsed from
a RTM_NEWROUTE message. This will help to distinguish local vs. peer
routes in a future change.

This means userspace will need to set a correct rtm_type in RTM_NEWROUTE
and RTM_DELROUTE messages; we currently only accept RTN_UNICAST.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20210810023834.2231088-1-jk@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jeremy Kerr
2021-08-10 10:38:34 +08:00
committed by Jakub Kicinski
parent ddccc5e368
commit 83f0a0b728
2 changed files with 23 additions and 5 deletions

View File

@@ -173,6 +173,7 @@ struct mctp_route {
struct mctp_dev *dev;
unsigned int mtu;
unsigned char type;
int (*output)(struct mctp_route *route,
struct sk_buff *skb);