diff options
author | Jeremy Kerr <jk@codeconstruct.com.au> | 2022-02-18 07:25:53 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-19 08:24:28 +0300 |
commit | cb196b725936f6b776ad1d073f66fbe92aa798fa (patch) | |
tree | b76857f6b1d1ffd35029a685aab647a3d9dc415e /net/mctp/route.c | |
parent | 47f0bd5032106469827cf56c8b45bb9101112105 (diff) | |
download | linux-cb196b725936f6b776ad1d073f66fbe92aa798fa.tar.xz |
mctp: replace mctp_address_ok with more fine-grained helpers
Currently, we have mctp_address_ok(), which checks if an EID is in the
"valid" range of 8-254 inclusive. However, 0 and 255 may also be valid
addresses, depending on context. 0 is the NULL EID, which may be set
when physical addressing is used. 255 is valid as a destination address
for broadcasts.
This change renames mctp_address_ok to mctp_address_unicast, and adds
similar helpers for broadcast and null EIDs, which will be used in an
upcoming commit.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mctp/route.c')
-rw-r--r-- | net/mctp/route.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mctp/route.c b/net/mctp/route.c index 0c4c56e1bd6e..6a11d78cfbab 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -962,7 +962,7 @@ static int mctp_route_add(struct mctp_dev *mdev, mctp_eid_t daddr_start, struct net *net = dev_net(mdev->dev); struct mctp_route *rt, *ert; - if (!mctp_address_ok(daddr_start)) + if (!mctp_address_unicast(daddr_start)) return -EINVAL; if (daddr_extent > 0xff || daddr_start + daddr_extent >= 255) |