diff options
author | 2022-02-18 12:25:53 +0800 | |
---|---|---|
committer | 2022-02-18 21:24:28 -0800 | |
commit | cb196b725936f6b776ad1d073f66fbe92aa798fa (patch) | |
tree | b76857f6b1d1ffd35029a685aab647a3d9dc415e /net/mctp/device.c | |
parent | net: Add new protocol attribute to IP addresses (diff) | |
download | linux-cb196b725936f6b776ad1d073f66fbe92aa798fa.tar.gz linux-cb196b725936f6b776ad1d073f66fbe92aa798fa.tar.bz2 linux-cb196b725936f6b776ad1d073f66fbe92aa798fa.zip |
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/device.c')
-rw-r--r-- | net/mctp/device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mctp/device.c b/net/mctp/device.c index 02ddc0f1bd3e..9e097e61f23a 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -209,7 +209,7 @@ static int mctp_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, if (!mdev) return -ENODEV; - if (!mctp_address_ok(addr->s_addr)) + if (!mctp_address_unicast(addr->s_addr)) return -EINVAL; /* Prevent duplicates. Under RTNL so don't need to lock for reading */ |