* [PATCH net-next-2.6] bonding: move dev_addr cpy to bond_enslave
@ 2010-05-19 11:14 Jiri Pirko
2010-06-02 11:17 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2010-05-19 11:14 UTC (permalink / raw)
To: netdev; +Cc: davem, fubar, bonding-devel
Move the code that copies slave's mac address in case that's the first slave into
bond_enslave. Ifenslave app does this also but that's not a problem. This is
something that should be done in bond_enslave, and it shound not matter from
where is it called.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
drivers/net/bonding/bond_main.c | 7 +++++++
drivers/net/bonding/bond_sysfs.c | 8 --------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2c3f9db..4e7473e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1522,6 +1522,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
}
}
+ /* If this is the first slave, then we need to set the master's hardware
+ * address to be the same as the slave's. */
+ if (bond->slave_cnt == 0)
+ memcpy(bond->dev->dev_addr, slave_dev->dev_addr,
+ slave_dev->addr_len);
+
+
new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
if (!new_slave) {
res = -ENOMEM;
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index a4cbaf7..496ac1e 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -250,14 +250,6 @@ static ssize_t bonding_store_slaves(struct device *d,
switch (command[0]) {
case '+':
pr_info("%s: Adding slave %s.\n", bond->dev->name, dev->name);
-
- /* If this is the first slave, then we need to set
- the master's hardware address to be the same as the
- slave's. */
- if (is_zero_ether_addr(bond->dev->dev_addr))
- memcpy(bond->dev->dev_addr, dev->dev_addr,
- dev->addr_len);
-
res = bond_enslave(bond->dev, dev);
break;
--
1.6.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next-2.6] bonding: move dev_addr cpy to bond_enslave
2010-05-19 11:14 [PATCH net-next-2.6] bonding: move dev_addr cpy to bond_enslave Jiri Pirko
@ 2010-06-02 11:17 ` David Miller
2010-06-02 11:20 ` Jiri Pirko
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2010-06-02 11:17 UTC (permalink / raw)
To: jpirko; +Cc: netdev, fubar, bonding-devel
From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 19 May 2010 13:14:29 +0200
> Move the code that copies slave's mac address in case that's the first slave into
> bond_enslave. Ifenslave app does this also but that's not a problem. This is
> something that should be done in bond_enslave, and it shound not matter from
> where is it called.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
(Jiri, please number your patches in a set, even if they should apply
properly independantly, thanks)
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next-2.6] bonding: move dev_addr cpy to bond_enslave
2010-06-02 11:17 ` David Miller
@ 2010-06-02 11:20 ` Jiri Pirko
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2010-06-02 11:20 UTC (permalink / raw)
To: David Miller; +Cc: netdev, fubar, bonding-devel
Wed, Jun 02, 2010 at 01:17:14PM CEST, davem@davemloft.net wrote:
>From: Jiri Pirko <jpirko@redhat.com>
>Date: Wed, 19 May 2010 13:14:29 +0200
>
>> Move the code that copies slave's mac address in case that's the first slave into
>> bond_enslave. Ifenslave app does this also but that's not a problem. This is
>> something that should be done in bond_enslave, and it shound not matter from
>> where is it called.
>>
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>(Jiri, please number your patches in a set, even if they should apply
> properly independantly, thanks)
Sorry, this was not ment to be a set. I was just posting patches as I went thru
the code. Will try to "buffer" it next time.
Thanks.
>
>Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-02 11:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-19 11:14 [PATCH net-next-2.6] bonding: move dev_addr cpy to bond_enslave Jiri Pirko
2010-06-02 11:17 ` David Miller
2010-06-02 11:20 ` Jiri Pirko
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).