mirror of
https://github.com/torvalds/linux.git
synced 2026-05-15 06:03:19 -04:00
can: vxcan: improve handling of missing peer name attribute
commitb4c2951a48upstream. Picking up the patch from Serhey Popovych (commit191cdb3822, "veth: Be more robust on network device creation when no attributes"). When the peer name attribute is not provided the former implementation tries to register the given device name twice ... which leads to -EEXIST. If only one device name is given apply an automatic generated and valid name for the peer. Cc: Serhey Popovych <serhe.popovych@gmail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
653c41ac47
commit
b043ea189d
@@ -194,7 +194,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,
|
||||
tbp = peer_tb;
|
||||
}
|
||||
|
||||
if (tbp[IFLA_IFNAME]) {
|
||||
if (ifmp && tbp[IFLA_IFNAME]) {
|
||||
nla_strlcpy(ifname, tbp[IFLA_IFNAME], IFNAMSIZ);
|
||||
name_assign_type = NET_NAME_USER;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user