* [PATCH] vxcan: improve handling of missing peer name attribute
@ 2017-12-02 17:48 Oliver Hartkopp
2017-12-11 13:45 ` Marc Kleine-Budde
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hartkopp @ 2017-12-02 17:48 UTC (permalink / raw)
To: linux-can; +Cc: Oliver Hartkopp, Serhey Popovych
Picking up the patch from Serhey Popovych (commit 191cdb3822e5df6b3c8,
"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>
---
drivers/net/can/vxcan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
index 8404e8852a0f..b4c4a2c76437 100644
--- a/drivers/net/can/vxcan.c
+++ b/drivers/net/can/vxcan.c
@@ -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 {
--
2.15.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vxcan: improve handling of missing peer name attribute
2017-12-02 17:48 [PATCH] vxcan: improve handling of missing peer name attribute Oliver Hartkopp
@ 2017-12-11 13:45 ` Marc Kleine-Budde
0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2017-12-11 13:45 UTC (permalink / raw)
To: Oliver Hartkopp, linux-can; +Cc: Serhey Popovych
[-- Attachment #1.1: Type: text/plain, Size: 871 bytes --]
On 12/02/2017 06:48 PM, Oliver Hartkopp wrote:
> Picking up the patch from Serhey Popovych (commit 191cdb3822e5df6b3c8,
> "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>
Applied to can.
tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-11 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-02 17:48 [PATCH] vxcan: improve handling of missing peer name attribute Oliver Hartkopp
2017-12-11 13:45 ` Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox