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>
                        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) {