diff options
author | Yi Zou <yi.zou@intel.com> | 2009-11-03 11:49:43 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-28 15:01:42 -0800 |
commit | 7c0798e2892bd16487e19ac87300013e3f7ec9e6 (patch) | |
tree | 876c631a73dd67298d576868fd9351ee61b4650f | |
parent | 1ce03481ed022f32b3912ec780388f40eff9cec2 (diff) | |
download | lwn-7c0798e2892bd16487e19ac87300013e3f7ec9e6.tar.gz lwn-7c0798e2892bd16487e19ac87300013e3f7ec9e6.zip |
fcoe: Fix getting san mac for VLAN interface
commit 5bab87e6d465d54a2b5899e0f583d42f00dbee2e upstream.
Make sure we are get the SAN MAC address from the real netdev if the input
netdev is a VLAN device.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 36f16a0bcf17..70ab5d0c5a48 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -160,6 +160,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe, { struct fcoe_ctlr *fip = &fcoe->ctlr; struct netdev_hw_addr *ha; + struct net_device *real_dev; u8 flogi_maddr[ETH_ALEN]; fcoe->netdev = netdev; @@ -173,8 +174,10 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe, /* look for SAN MAC address, if multiple SAN MACs exist, only * use the first one for SPMA */ + real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ? + vlan_dev_real_dev(netdev) : netdev; rcu_read_lock(); - for_each_dev_addr(netdev, ha) { + for_each_dev_addr(real_dev, ha) { if ((ha->type == NETDEV_HW_ADDR_T_SAN) && (is_valid_ether_addr(ha->addr))) { memcpy(fip->ctl_src_addr, ha->addr, ETH_ALEN); |