aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 00:00:52 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 18:08:42 -0500
commit78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch)
tree9dccc5c16bf269d53d8499064ec95a998e84c646 /net/ipv4/af_inet.c
parent1561747ddf9d28185548687b11aae7074d6129c4 (diff)
ipv4: Create and use route lookup helpers.
The idea here is this minimizes the number of places one has to edit in order to make changes to how flows are defined and used. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 35a502055018..807d83c02ef6 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1157,22 +1157,10 @@ int inet_sk_rebuild_header(struct sock *sk)
1157 daddr = inet->inet_daddr; 1157 daddr = inet->inet_daddr;
1158 if (inet->opt && inet->opt->srr) 1158 if (inet->opt && inet->opt->srr)
1159 daddr = inet->opt->faddr; 1159 daddr = inet->opt->faddr;
1160 { 1160 rt = ip_route_output_ports(sock_net(sk), sk, daddr, inet->inet_saddr,
1161 struct flowi fl = { 1161 inet->inet_dport, inet->inet_sport,
1162 .oif = sk->sk_bound_dev_if, 1162 sk->sk_protocol, RT_CONN_FLAGS(sk),
1163 .mark = sk->sk_mark, 1163 sk->sk_bound_dev_if);
1164 .fl4_dst = daddr,
1165 .fl4_src = inet->inet_saddr,
1166 .fl4_tos = RT_CONN_FLAGS(sk),
1167 .proto = sk->sk_protocol,
1168 .flags = inet_sk_flowi_flags(sk),
1169 .fl_ip_sport = inet->inet_sport,
1170 .fl_ip_dport = inet->inet_dport,
1171 };
1172
1173 security_sk_classify_flow(sk, &fl);
1174 rt = ip_route_output_flow(sock_net(sk), &fl, sk);
1175 }
1176 if (!IS_ERR(rt)) { 1164 if (!IS_ERR(rt)) {
1177 err = 0; 1165 err = 0;
1178 sk_setup_caps(sk, &rt->dst); 1166 sk_setup_caps(sk, &rt->dst);