diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-11-12 13:43:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-17 15:27:45 -0500 |
commit | 5811662b15db018c740c57d037523683fd3e6123 (patch) | |
tree | f820610a6024799a26699f22dc9a4ef5dee07978 /net/ipv4/ip_output.c | |
parent | dd68ad2235b4625e0dc928b2b4c614d265f976d3 (diff) |
net: use the macros defined for the members of flowi
Use the macros defined for the members of flowi to clean the code up.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 439d2a34ee44..5090c7ff525e 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -341,15 +341,13 @@ int ip_queue_xmit(struct sk_buff *skb) | |||
341 | { | 341 | { |
342 | struct flowi fl = { .oif = sk->sk_bound_dev_if, | 342 | struct flowi fl = { .oif = sk->sk_bound_dev_if, |
343 | .mark = sk->sk_mark, | 343 | .mark = sk->sk_mark, |
344 | .nl_u = { .ip4_u = | 344 | .fl4_dst = daddr, |
345 | { .daddr = daddr, | 345 | .fl4_src = inet->inet_saddr, |
346 | .saddr = inet->inet_saddr, | 346 | .fl4_tos = RT_CONN_FLAGS(sk), |
347 | .tos = RT_CONN_FLAGS(sk) } }, | ||
348 | .proto = sk->sk_protocol, | 347 | .proto = sk->sk_protocol, |
349 | .flags = inet_sk_flowi_flags(sk), | 348 | .flags = inet_sk_flowi_flags(sk), |
350 | .uli_u = { .ports = | 349 | .fl_ip_sport = inet->inet_sport, |
351 | { .sport = inet->inet_sport, | 350 | .fl_ip_dport = inet->inet_dport }; |
352 | .dport = inet->inet_dport } } }; | ||
353 | 351 | ||
354 | /* If this fails, retransmit mechanism of transport layer will | 352 | /* If this fails, retransmit mechanism of transport layer will |
355 | * keep trying until route appears or the connection times | 353 | * keep trying until route appears or the connection times |
@@ -1404,14 +1402,11 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1404 | 1402 | ||
1405 | { | 1403 | { |
1406 | struct flowi fl = { .oif = arg->bound_dev_if, | 1404 | struct flowi fl = { .oif = arg->bound_dev_if, |
1407 | .nl_u = { .ip4_u = | 1405 | .fl4_dst = daddr, |
1408 | { .daddr = daddr, | 1406 | .fl4_src = rt->rt_spec_dst, |
1409 | .saddr = rt->rt_spec_dst, | 1407 | .fl4_tos = RT_TOS(ip_hdr(skb)->tos), |
1410 | .tos = RT_TOS(ip_hdr(skb)->tos) } }, | 1408 | .fl_ip_sport = tcp_hdr(skb)->dest, |
1411 | /* Not quite clean, but right. */ | 1409 | .fl_ip_dport = tcp_hdr(skb)->source, |
1412 | .uli_u = { .ports = | ||
1413 | { .sport = tcp_hdr(skb)->dest, | ||
1414 | .dport = tcp_hdr(skb)->source } }, | ||
1415 | .proto = sk->sk_protocol, | 1410 | .proto = sk->sk_protocol, |
1416 | .flags = ip_reply_arg_flowi_flags(arg) }; | 1411 | .flags = ip_reply_arg_flowi_flags(arg) }; |
1417 | security_skb_classify_flow(skb, &fl); | 1412 | security_skb_classify_flow(skb, &fl); |