]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
scsi: libcxgbi: in case of vlan pass 0 as ifindex to find route
authorVarun Prakash <varun@chelsio.com>
Tue, 10 Oct 2017 13:55:30 +0000 (19:25 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 11 Oct 2017 18:24:58 +0000 (14:24 -0400)
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>
drivers/scsi/cxgbi/libcxgbi.c

index da36c2de069e7f7b11b9281bfda1e02ad6f916df..f39d4d107114edb20a9c785c83fae308ce1b4d34 100644 (file)
@@ -2554,7 +2554,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) {