netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bonding: Don't allow bond devices to change network namespaces.
@ 2014-01-22  9:16 Chen Weilong
  2014-01-22  9:41 ` Jiri Pirko
  2014-01-23  5:59 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Chen Weilong @ 2014-01-22  9:16 UTC (permalink / raw)
  To: fubar, vfalico, andy, davem; +Cc: netdev

From: Weilong Chen <chenweilong@huawei.com>

Like bridge, bonding as netdevice doesn't cross netns boundaries.

Bonding ports and bonding itself live in same netns.

Signed-off-by: Weilong Chen <chenweilong@huawei.com>
---
 drivers/net/bonding/bond_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f00dd45..897d153 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3916,6 +3916,9 @@ void bond_setup(struct net_device *bond_dev)
 	 * capable
 	 */
 
+	/* Don't allow bond devices to change network namespaces. */
+	bond_dev->features |= NETIF_F_NETNS_LOCAL;
+
 	bond_dev->hw_features = BOND_VLAN_FEATURES |
 				NETIF_F_HW_VLAN_CTAG_TX |
 				NETIF_F_HW_VLAN_CTAG_RX |
-- 
1.7.12

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] bonding: Don't allow bond devices to change network namespaces.
  2014-01-22  9:16 [PATCH] bonding: Don't allow bond devices to change network namespaces Chen Weilong
@ 2014-01-22  9:41 ` Jiri Pirko
  2014-01-23  2:41   ` chenweilong
  2014-01-23  5:59 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2014-01-22  9:41 UTC (permalink / raw)
  To: Chen Weilong; +Cc: fubar, vfalico, andy, davem, netdev

Wed, Jan 22, 2014 at 10:16:30AM CET, chenweilong@huawei.com wrote:
>From: Weilong Chen <chenweilong@huawei.com>
>
>Like bridge, bonding as netdevice doesn't cross netns boundaries.
>
>Bonding ports and bonding itself live in same netns.

I think should should be done for team as well. Openvs already
has this. I believe that for vlans it is ok to change ns, right?

>
>Signed-off-by: Weilong Chen <chenweilong@huawei.com>
>---
> drivers/net/bonding/bond_main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index f00dd45..897d153 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -3916,6 +3916,9 @@ void bond_setup(struct net_device *bond_dev)
> 	 * capable
> 	 */
> 
>+	/* Don't allow bond devices to change network namespaces. */
>+	bond_dev->features |= NETIF_F_NETNS_LOCAL;
>+
> 	bond_dev->hw_features = BOND_VLAN_FEATURES |
> 				NETIF_F_HW_VLAN_CTAG_TX |
> 				NETIF_F_HW_VLAN_CTAG_RX |
>-- 
>1.7.12
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bonding: Don't allow bond devices to change network namespaces.
  2014-01-22  9:41 ` Jiri Pirko
@ 2014-01-23  2:41   ` chenweilong
  0 siblings, 0 replies; 4+ messages in thread
From: chenweilong @ 2014-01-23  2:41 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: fubar, vfalico, andy, davem, netdev

On 2014/1/22 17:41, Jiri Pirko wrote:
> Wed, Jan 22, 2014 at 10:16:30AM CET, chenweilong@huawei.com wrote:
>> From: Weilong Chen <chenweilong@huawei.com>
>>
>> Like bridge, bonding as netdevice doesn't cross netns boundaries.
>>
>> Bonding ports and bonding itself live in same netns.
> 
> I think should should be done for team as well. Openvs already
> has this. I believe that for vlans it is ok to change ns, right?
> 

OK, I'll write a new patch for 'team'.

For vlan dev, I think it's more complex.
1.Move vlan dev to a new ns, its real dev is in old ns, vlan
  can not work.
2.Move vlan real dev to a new ns, vlan dev is in old ns, vlan
  can not work.
If someone want to move vlan and its real dev to new ns, he must
do 1) and 2) or 2) and 1), both way are breaking the vlan down. I
think move real dev to new ns, and add a new vlan dev will be better.

Maybe I need write another patch for 'vlan'.

>>
>> Signed-off-by: Weilong Chen <chenweilong@huawei.com>
>> ---
>> drivers/net/bonding/bond_main.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index f00dd45..897d153 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -3916,6 +3916,9 @@ void bond_setup(struct net_device *bond_dev)
>> 	 * capable
>> 	 */
>>
>> +	/* Don't allow bond devices to change network namespaces. */
>> +	bond_dev->features |= NETIF_F_NETNS_LOCAL;
>> +
>> 	bond_dev->hw_features = BOND_VLAN_FEATURES |
>> 				NETIF_F_HW_VLAN_CTAG_TX |
>> 				NETIF_F_HW_VLAN_CTAG_RX |
>> -- 
>> 1.7.12
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bonding: Don't allow bond devices to change network namespaces.
  2014-01-22  9:16 [PATCH] bonding: Don't allow bond devices to change network namespaces Chen Weilong
  2014-01-22  9:41 ` Jiri Pirko
@ 2014-01-23  5:59 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-01-23  5:59 UTC (permalink / raw)
  To: chenweilong; +Cc: fubar, vfalico, andy, netdev

From: Chen Weilong <chenweilong@huawei.com>
Date: Wed, 22 Jan 2014 17:16:30 +0800

> From: Weilong Chen <chenweilong@huawei.com>
> 
> Like bridge, bonding as netdevice doesn't cross netns boundaries.
> 
> Bonding ports and bonding itself live in same netns.
> 
> Signed-off-by: Weilong Chen <chenweilong@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-23  5:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22  9:16 [PATCH] bonding: Don't allow bond devices to change network namespaces Chen Weilong
2014-01-22  9:41 ` Jiri Pirko
2014-01-23  2:41   ` chenweilong
2014-01-23  5:59 ` David Miller

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).