summaryrefslogtreecommitdiff
path: root/net/mctp/route.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2022-02-09 12:05:56 +0800
committerDavid S. Miller <davem@davemloft.net>2022-02-09 12:00:11 +0000
commit0de55a7d1133d0ab1acad5d91eea6ccd8cf6d448 (patch)
treeb55293885a7f9ae8293cc93a2408bd46458bda21 /net/mctp/route.c
parent8069b22d656f6e1922352bff90ab78e6fab73779 (diff)
mctp: Allow keys matching any local address
Currently, we require an exact match on an incoming packet's dest address, and the key's local_addr field. In a future change, we may want to set up a key before packets are routed, meaning we have no local address to match on. This change allows key lookups to match on local_addr = MCTP_ADDR_ANY. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mctp/route.c')
-rw-r--r--net/mctp/route.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mctp/route.c b/net/mctp/route.c
index 654467a7aeae..35f72e99e188 100644
--- a/net/mctp/route.c
+++ b/net/mctp/route.c
@@ -76,7 +76,7 @@ static struct mctp_sock *mctp_lookup_bind(struct net *net, struct sk_buff *skb)
static bool mctp_key_match(struct mctp_sk_key *key, mctp_eid_t local,
mctp_eid_t peer, u8 tag)
{
- if (key->local_addr != local)
+ if (!mctp_address_matches(key->local_addr, local))
return false;
if (key->peer_addr != peer)
@@ -616,7 +616,7 @@ static struct mctp_sk_key *mctp_alloc_local_tag(struct mctp_sock *msk,
continue;
if (!(mctp_address_matches(tmp->peer_addr, daddr) &&
- tmp->local_addr == saddr))
+ mctp_address_matches(tmp->local_addr, saddr)))
continue;
spin_lock(&tmp->lock);