mctp: Don't let RTM_DELROUTE delete local routes
authorMatt Johnston <matt@codeconstruct.com.au>
Wed, 1 Dec 2021 08:07:42 +0000 (16:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:53 +0000 (09:04 +0100)
commit812ed9b71246a9dcbbee08b046157d8f8cca3d7c
tree2f73fbc012b37f135536c06c2298a280b3b874a2
parentf1bcddbc7b6095b488ec892d687233095756ee28
mctp: Don't let RTM_DELROUTE delete local routes

[ Upstream commit 76d001603c509562181f3787a7065b8e163bc7b9 ]

We need to test against the existing route type, not
the rtm_type in the netlink request.

Fixes: 83f0a0b7285b ("mctp: Specify route types, require rtm_type in RTM_*ROUTE messages")
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mctp/route.c