mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-10 00:33:22 -04:00
net: rmnet: do not allow to change mux id if mux id is duplicated
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: 23790ef120
("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>
This commit is contained in:
parent
c026d97010
commit
1dc49e9d16
1 changed files with 4 additions and 0 deletions
|
@ -306,6 +306,10 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
|
||||||
|
|
||||||
if (data[IFLA_RMNET_MUX_ID]) {
|
if (data[IFLA_RMNET_MUX_ID]) {
|
||||||
mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
|
mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
|
||||||
|
if (rmnet_get_endpoint(port, mux_id)) {
|
||||||
|
NL_SET_ERR_MSG_MOD(extack, "MUX ID already exists");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
ep = rmnet_get_endpoint(port, priv->mux_id);
|
ep = rmnet_get_endpoint(port, priv->mux_id);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue