summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2022-02-09 07:05:55 +0300
committerJoel Stanley <joel@jms.id.au>2022-03-18 03:38:33 +0300
commit09ee56d93db6eb9c8919891edc20a398cacdd27c (patch)
treefe1fed33aef6259b12cac69e5a4b065fc47023c5 /include/net
parentb1bf0db4fec282d2ee30edfcfced147255b4a2d8 (diff)
downloadlinux-09ee56d93db6eb9c8919891edc20a398cacdd27c.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. OpenBMC-Staging-Count: 1 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 8069b22d656f6e1922352bff90ab78e6fab73779) Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/mctp.h5
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);