Commit 1679ea99 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'amt-fix-several-bugs'

Taehee Yoo says:

====================
amt: fix several bugs

This patchset fixes several bugs in amt module

First patch fixes typo.

Second patch fixes wrong return value of amt_update_handler().
A relay finds a tunnel if it receives an update message from the gateway.
If it can't find a tunnel, amt_update_handler() should return an error,
not success. But it always returns success.

Third patch fixes a possible memory leak in amt_rcv().
A skb would not be freed if an amt interface doesn't have a socket.
====================

Link: https://lore.kernel.org/r/20220523161708.29518-1-ap420073@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 7e062cda 1a1a0e80
...@@ -57,7 +57,7 @@ static char *type_str[] = { ...@@ -57,7 +57,7 @@ static char *type_str[] = {
"AMT_MSG_MEMBERSHIP_QUERY", "AMT_MSG_MEMBERSHIP_QUERY",
"AMT_MSG_MEMBERSHIP_UPDATE", "AMT_MSG_MEMBERSHIP_UPDATE",
"AMT_MSG_MULTICAST_DATA", "AMT_MSG_MULTICAST_DATA",
"AMT_MSG_TEARDOWM", "AMT_MSG_TEARDOWN",
}; };
static char *action_str[] = { static char *action_str[] = {
...@@ -2423,7 +2423,7 @@ static bool amt_update_handler(struct amt_dev *amt, struct sk_buff *skb) ...@@ -2423,7 +2423,7 @@ static bool amt_update_handler(struct amt_dev *amt, struct sk_buff *skb)
} }
} }
return false; return true;
report: report:
iph = ip_hdr(skb); iph = ip_hdr(skb);
...@@ -2679,7 +2679,7 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb) ...@@ -2679,7 +2679,7 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb)
amt = rcu_dereference_sk_user_data(sk); amt = rcu_dereference_sk_user_data(sk);
if (!amt) { if (!amt) {
err = true; err = true;
goto out; goto drop;
} }
skb->dev = amt->dev; skb->dev = amt->dev;
......
...@@ -15,7 +15,7 @@ enum amt_msg_type { ...@@ -15,7 +15,7 @@ enum amt_msg_type {
AMT_MSG_MEMBERSHIP_QUERY, AMT_MSG_MEMBERSHIP_QUERY,
AMT_MSG_MEMBERSHIP_UPDATE, AMT_MSG_MEMBERSHIP_UPDATE,
AMT_MSG_MULTICAST_DATA, AMT_MSG_MULTICAST_DATA,
AMT_MSG_TEARDOWM, AMT_MSG_TEARDOWN,
__AMT_MSG_MAX, __AMT_MSG_MAX,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment