mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
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>
This commit is contained in:
committed by
David S. Miller
parent
c575521462
commit
8069b22d65
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user