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/icmp.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/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index c6e2affafbd3..4daebd17b6ed 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -386,10 +386,9 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) | |||
386 | daddr = icmp_param->replyopts.faddr; | 386 | daddr = icmp_param->replyopts.faddr; |
387 | } | 387 | } |
388 | { | 388 | { |
389 | struct flowi fl = { .nl_u = { .ip4_u = | 389 | struct flowi fl = { .fl4_dst= daddr, |
390 | { .daddr = daddr, | 390 | .fl4_src = rt->rt_spec_dst, |
391 | .saddr = rt->rt_spec_dst, | 391 | .fl4_tos = RT_TOS(ip_hdr(skb)->tos), |
392 | .tos = RT_TOS(ip_hdr(skb)->tos) } }, | ||
393 | .proto = IPPROTO_ICMP }; | 392 | .proto = IPPROTO_ICMP }; |
394 | security_skb_classify_flow(skb, &fl); | 393 | security_skb_classify_flow(skb, &fl); |
395 | if (ip_route_output_key(net, &rt, &fl)) | 394 | if (ip_route_output_key(net, &rt, &fl)) |
@@ -542,22 +541,13 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) | |||
542 | 541 | ||
543 | { | 542 | { |
544 | struct flowi fl = { | 543 | struct flowi fl = { |
545 | .nl_u = { | 544 | .fl4_dst = icmp_param.replyopts.srr ? |
546 | .ip4_u = { | 545 | icmp_param.replyopts.faddr : iph->saddr, |
547 | .daddr = icmp_param.replyopts.srr ? | 546 | .fl4_src = saddr, |
548 | icmp_param.replyopts.faddr : | 547 | .fl4_tos = RT_TOS(tos), |
549 | iph->saddr, | ||
550 | .saddr = saddr, | ||
551 | .tos = RT_TOS(tos) | ||
552 | } | ||
553 | }, | ||
554 | .proto = IPPROTO_ICMP, | 548 | .proto = IPPROTO_ICMP, |
555 | .uli_u = { | 549 | .fl_icmp_type = type, |
556 | .icmpt = { | 550 | .fl_icmp_code = code, |
557 | .type = type, | ||
558 | .code = code | ||
559 | } | ||
560 | } | ||
561 | }; | 551 | }; |
562 | int err; | 552 | int err; |
563 | struct rtable *rt2; | 553 | struct rtable *rt2; |