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

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.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 7e062cda 1a1a0e80
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ static char *type_str[] = {
	"AMT_MSG_MEMBERSHIP_QUERY",
	"AMT_MSG_MEMBERSHIP_UPDATE",
	"AMT_MSG_MULTICAST_DATA",
	"AMT_MSG_TEARDOWM",
	"AMT_MSG_TEARDOWN",
};

static char *action_str[] = {
@@ -2423,7 +2423,7 @@ static bool amt_update_handler(struct amt_dev *amt, struct sk_buff *skb)
		}
	}

	return false;
	return true;

report:
	iph = ip_hdr(skb);
@@ -2679,7 +2679,7 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb)
	amt = rcu_dereference_sk_user_data(sk);
	if (!amt) {
		err = true;
		goto out;
		goto drop;
	}

	skb->dev = amt->dev;
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ enum amt_msg_type {
	AMT_MSG_MEMBERSHIP_QUERY,
	AMT_MSG_MEMBERSHIP_UPDATE,
	AMT_MSG_MULTICAST_DATA,
	AMT_MSG_TEARDOWM,
	AMT_MSG_TEARDOWN,
	__AMT_MSG_MAX,
};