net: rmnet: do not allow to change mux id if mux id is duplicated
authorTaehee Yoo <ap420073@gmail.com>
Thu, 27 Feb 2020 12:25:19 +0000 (12:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 10:55:55 +0000 (11:55 +0100)
commit48c5bfbbcec1e9218451611ff576901807bbbfc5
treea04849133c246d378e746143b8a1a34719eac297
parent7111ec0927f14b52c16577d281862faae2178fed
net: rmnet: do not allow to change mux id if mux id is duplicated

[ Upstream commit 1dc49e9d164cd7e11c81279c83db84a147e14740 ]

Basically, duplicate mux id isn't be allowed.
So, the creation of rmnet will be failed if there is duplicate mux id
is existing.
But, changelink routine doesn't check duplicate mux id.

Test commands:
    modprobe rmnet
    ip link add dummy0 type dummy
    ip link add rmnet0 link dummy0 type rmnet mux_id 1
    ip link add rmnet1 link dummy0 type rmnet mux_id 2
    ip link set rmnet1 type rmnet mux_id 1

Fixes: 23790ef12082 ("net: qualcomm: rmnet: Allow to configure flags for existing devices")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c