Skip to content

Commit 1dc49e9

Browse files
TaeheeYoodavem330
authored andcommitted
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: 23790ef ("net: qualcomm: rmnet: Allow to configure flags for existing devices") Signed-off-by: Taehee Yoo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c026d97 commit 1dc49e9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
306306

307307
if (data[IFLA_RMNET_MUX_ID]) {
308308
mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
309+
if (rmnet_get_endpoint(port, mux_id)) {
310+
NL_SET_ERR_MSG_MOD(extack, "MUX ID already exists");
311+
return -EINVAL;
312+
}
309313
ep = rmnet_get_endpoint(port, priv->mux_id);
310314
if (!ep)
311315
return -ENODEV;

0 commit comments

Comments
 (0)