netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: serhe.popovych@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: veth: Be more robust on network device creation when no attributes
Date: Thu, 22 Jun 2017 11:16:42 -0400 (EDT)	[thread overview]
Message-ID: <20170622.111642.1304217851524877946.davem@davemloft.net> (raw)
In-Reply-To: <1498036344-10301-1-git-send-email-serhe.popovych@gmail.com>

From: Serhey Popovych <serhe.popovych@gmail.com>
Date: Wed, 21 Jun 2017 12:12:24 +0300

> There are number of problems with configuration peer
> network device in absence of IFLA_VETH_PEER attributes
> where attributes for main network device shared with
> peer.
> 
> First it is not feasible to configure both network
> devices with same MAC address since this makes
> communication in such configuration problematic.
> 
> This case can be reproduced with following sequence:
> 
>   # ip link add address 02:11:22:33:44:55 type veth
>   # ip li sh
>   ...
>   26: veth0@veth1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc \
>   noop state DOWN mode DEFAULT qlen 1000
>       link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
>   27: veth1@veth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc \
>   noop state DOWN mode DEFAULT qlen 1000
>       link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
> 
> Second it is not possible to register both main and
> peer network devices with same name, that happens
> when name for main interface is given with IFLA_IFNAME
> and same attribute reused for peer.
> 
> This case can be reproduced with following sequence:
> 
>   # ip link add dev veth1a type veth
>   RTNETLINK answers: File exists
> 
> To fix both of the cases check if corresponding netlink
> attributes are taken from peer_tb when valid or
> name based on rtnl ops kind and random address is used.
> 
> Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>

Applied.

      reply	other threads:[~2017-06-22 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 15:05 [PATCH] veth: Be more robust on network device creation when no attributes Serhey Popovych
2017-06-20 16:40 ` David Miller
2017-06-21  9:02   ` Serhey Popovych
2017-06-21  9:12     ` Serhey Popovych
2017-06-22 15:16       ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170622.111642.1304217851524877946.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=serhe.popovych@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).