From: Varun Prakash <varun@chelsio.com>
Date: Tue, 10 Oct 2017 19:25:30 +0530
Subject: [PATCH] scsi: libcxgbi: in case of vlan pass 0 as ifindex to find
route
References: bsc#1077989
Git-commit: 4c2a02157fdd5dc71de7cf42eff07576746eb450
Patch-mainline: v4.15-rc1
In case of vlan pass 0 as ifindex to find route instead of passing
real_dev ifindex, if we pass real_dev ifindex then
ip_route_output_ports() and ip6_route_output() will check for route
through real_dev not through vlan interface.
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/scsi/cxgbi/libcxgbi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 11735f8051b8..66c0d9816d44 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2567,7 +2567,10 @@ struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *shost,
goto err_out;
}
- ifindex = hba->ndev->ifindex;
+ rtnl_lock();
+ if (!vlan_uses_dev(hba->ndev))
+ ifindex = hba->ndev->ifindex;
+ rtnl_unlock();
}
if (dst_addr->sa_family == AF_INET) {
--
2.12.3