diff options
author | Jeremy Kerr <jk@codeconstruct.com.au> | 2022-02-09 07:05:55 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-02-09 15:00:11 +0300 |
commit | 8069b22d656f6e1922352bff90ab78e6fab73779 (patch) | |
tree | 72fcc88a0c017ae74d453941469c34c1ed38ab52 /include/net/mctp.h | |
parent | c5755214623dd7aaafc5204458a0a30b7469850c (diff) | |
download | linux-8069b22d656f6e1922352bff90ab78e6fab73779.tar.xz |
mctp: Add helper for address match checking
Currently, we have a couple of paths that check that an EID matches, or
the match value is MCTP_ADDR_ANY.
Rather than open coding this, add a little helper.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mctp.h')
-rw-r--r-- | include/net/mctp.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/mctp.h b/include/net/mctp.h index 7e35ec79b909..706d329dd8e8 100644 --- a/include/net/mctp.h +++ b/include/net/mctp.h @@ -45,6 +45,11 @@ static inline bool mctp_address_ok(mctp_eid_t eid) return eid >= 8 && eid < 255; } +static inline bool mctp_address_matches(mctp_eid_t match, mctp_eid_t eid) +{ + return match == eid || match == MCTP_ADDR_ANY; +} + static inline struct mctp_hdr *mctp_hdr(struct sk_buff *skb) { return (struct mctp_hdr *)skb_network_header(skb); |