return 0;
}
+static inline struct net_device *cnic_get_physical(struct net_device *dev)
+{
+ extern struct net_device *br_locate_physical_device(struct net_device *dev);
+ if (dev->priv_flags & IFF_EBRIDGE)
+ dev = br_locate_physical_device(dev);
+ return dev;
+}
+
#ifndef __VMKLNX__
static int cnic_get_v4_route(struct sockaddr_in *dst_addr,
struct sockaddr_in *src_addr,
{
struct cnic_dev *dev = NULL;
struct dst_entry *dst;
- struct net_device *netdev = NULL;
+ struct net_device *dstdev, *netdev = NULL;
int err = -ENETUNREACH, found = 0;
if (dst_addr->sin_family == AF_INET)
if (!dst->dev)
goto done;
- cnic_get_vlan(dst->dev, &netdev);
+ dstdev = cnic_get_physical(dst->dev);
+ cnic_get_vlan(dstdev, &netdev);
read_lock(&cnic_dev_lock);
list_for_each_entry(dev, &cnic_dev_list, list) {
struct cnic_dev *dev = csk->dev;
int is_v6, err;
struct dst_entry *dst;
- struct net_device *realdev;
+ struct net_device *dstdev, *realdev;
if (saddr->local.v6.sin6_family == AF_INET6 &&
saddr->remote.v6.sin6_family == AF_INET6)
}
}
- csk->vlan_id = cnic_get_vlan(dst->dev, &realdev);
+ dstdev = cnic_get_physical(dst->dev);
+ csk->vlan_id = cnic_get_vlan(dstdev, &realdev);
+
if (realdev != dev->netdev)
goto err_out;