summaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorDavid Ahern2015-08-17 01:13:27 +0200
committerDavid S. Miller2015-08-18 00:58:57 +0200
commitdc028da54ed353edd44dca88b7eb19fd5126c354 (patch)
treecd11c264faf0bfbdbba0b6da9e7b058eab38c968 /net/ipv4/af_inet.c
parentnet: Fix docbook warning for IFF_VRF_MASTER enum (diff)
downloadkernel-qcow2-linux-dc028da54ed353edd44dca88b7eb19fd5126c354.tar.gz
kernel-qcow2-linux-dc028da54ed353edd44dca88b7eb19fd5126c354.tar.xz
kernel-qcow2-linux-dc028da54ed353edd44dca88b7eb19fd5126c354.zip
inet: Move VRF table lookup to inlined function
Table lookup compiles out when VRF is not enabled. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index c8b855882fa5..675e88cac2b4 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -450,15 +450,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out;
}
- if (sk->sk_bound_dev_if) {
- struct net_device *dev;
-
- rcu_read_lock();
- dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
- if (dev)
- tb_id = vrf_dev_table_rcu(dev) ? : tb_id;
- rcu_read_unlock();
- }
+ tb_id = vrf_dev_table_ifindex(net, sk->sk_bound_dev_if) ? : tb_id;
chk_addr_ret = inet_addr_type_table(net, addr->sin_addr.s_addr, tb_id);
/* Not specified by any standard per-se, however it breaks too