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/ipv6 | |
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/ipv6')
-rw-r--r-- | net/ipv6/ip6mr.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter.c | 6 | ||||
-rw-r--r-- | net/ipv6/route.c | 24 | ||||
-rw-r--r-- | net/ipv6/sit.c | 14 |
4 files changed, 15 insertions, 33 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 6f32ffce7022..9fab274019c0 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -1843,9 +1843,7 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt, | |||
1843 | 1843 | ||
1844 | fl = (struct flowi) { | 1844 | fl = (struct flowi) { |
1845 | .oif = vif->link, | 1845 | .oif = vif->link, |
1846 | .nl_u = { .ip6_u = | 1846 | .fl6_dst = ipv6h->daddr, |
1847 | { .daddr = ipv6h->daddr, } | ||
1848 | } | ||
1849 | }; | 1847 | }; |
1850 | 1848 | ||
1851 | dst = ip6_route_output(net, NULL, &fl); | 1849 | dst = ip6_route_output(net, NULL, &fl); |
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c index 7155b2451d7c..35915e8617f0 100644 --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c | |||
@@ -18,10 +18,8 @@ int ip6_route_me_harder(struct sk_buff *skb) | |||
18 | struct flowi fl = { | 18 | struct flowi fl = { |
19 | .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, | 19 | .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, |
20 | .mark = skb->mark, | 20 | .mark = skb->mark, |
21 | .nl_u = | 21 | .fl6_dst = iph->daddr, |
22 | { .ip6_u = | 22 | .fl6_src = iph->saddr, |
23 | { .daddr = iph->daddr, | ||
24 | .saddr = iph->saddr, } }, | ||
25 | }; | 23 | }; |
26 | 24 | ||
27 | dst = ip6_route_output(net, skb->sk, &fl); | 25 | dst = ip6_route_output(net, skb->sk, &fl); |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 96455ffb76fb..c346ccf66ae1 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -558,11 +558,7 @@ struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr, | |||
558 | { | 558 | { |
559 | struct flowi fl = { | 559 | struct flowi fl = { |
560 | .oif = oif, | 560 | .oif = oif, |
561 | .nl_u = { | 561 | .fl6_dst = *daddr, |
562 | .ip6_u = { | ||
563 | .daddr = *daddr, | ||
564 | }, | ||
565 | }, | ||
566 | }; | 562 | }; |
567 | struct dst_entry *dst; | 563 | struct dst_entry *dst; |
568 | int flags = strict ? RT6_LOOKUP_F_IFACE : 0; | 564 | int flags = strict ? RT6_LOOKUP_F_IFACE : 0; |
@@ -778,13 +774,9 @@ void ip6_route_input(struct sk_buff *skb) | |||
778 | int flags = RT6_LOOKUP_F_HAS_SADDR; | 774 | int flags = RT6_LOOKUP_F_HAS_SADDR; |
779 | struct flowi fl = { | 775 | struct flowi fl = { |
780 | .iif = skb->dev->ifindex, | 776 | .iif = skb->dev->ifindex, |
781 | .nl_u = { | 777 | .fl6_dst = iph->daddr, |
782 | .ip6_u = { | 778 | .fl6_src = iph->saddr, |
783 | .daddr = iph->daddr, | 779 | .fl6_flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK, |
784 | .saddr = iph->saddr, | ||
785 | .flowlabel = (* (__be32 *) iph)&IPV6_FLOWINFO_MASK, | ||
786 | }, | ||
787 | }, | ||
788 | .mark = skb->mark, | 780 | .mark = skb->mark, |
789 | .proto = iph->nexthdr, | 781 | .proto = iph->nexthdr, |
790 | }; | 782 | }; |
@@ -1463,12 +1455,8 @@ static struct rt6_info *ip6_route_redirect(struct in6_addr *dest, | |||
1463 | struct ip6rd_flowi rdfl = { | 1455 | struct ip6rd_flowi rdfl = { |
1464 | .fl = { | 1456 | .fl = { |
1465 | .oif = dev->ifindex, | 1457 | .oif = dev->ifindex, |
1466 | .nl_u = { | 1458 | .fl6_dst = *dest, |
1467 | .ip6_u = { | 1459 | .fl6_src = *src, |
1468 | .daddr = *dest, | ||
1469 | .saddr = *src, | ||
1470 | }, | ||
1471 | }, | ||
1472 | }, | 1460 | }, |
1473 | }; | 1461 | }; |
1474 | 1462 | ||
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index d6bfaec3bbbf..6e48a80d0f25 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -730,10 +730,9 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
730 | } | 730 | } |
731 | 731 | ||
732 | { | 732 | { |
733 | struct flowi fl = { .nl_u = { .ip4_u = | 733 | struct flowi fl = { .fl4_dst = dst, |
734 | { .daddr = dst, | 734 | .fl4_src = tiph->saddr, |
735 | .saddr = tiph->saddr, | 735 | .fl4_tos = RT_TOS(tos), |
736 | .tos = RT_TOS(tos) } }, | ||
737 | .oif = tunnel->parms.link, | 736 | .oif = tunnel->parms.link, |
738 | .proto = IPPROTO_IPV6 }; | 737 | .proto = IPPROTO_IPV6 }; |
739 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | 738 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { |
@@ -855,10 +854,9 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev) | |||
855 | iph = &tunnel->parms.iph; | 854 | iph = &tunnel->parms.iph; |
856 | 855 | ||
857 | if (iph->daddr) { | 856 | if (iph->daddr) { |
858 | struct flowi fl = { .nl_u = { .ip4_u = | 857 | struct flowi fl = { .fl4_dst = iph->daddr, |
859 | { .daddr = iph->daddr, | 858 | .fl4_src = iph->saddr, |
860 | .saddr = iph->saddr, | 859 | .fl4_tos = RT_TOS(iph->tos), |
861 | .tos = RT_TOS(iph->tos) } }, | ||
862 | .oif = tunnel->parms.link, | 860 | .oif = tunnel->parms.link, |
863 | .proto = IPPROTO_IPV6 }; | 861 | .proto = IPPROTO_IPV6 }; |
864 | struct rtable *rt; | 862 | struct rtable *rt; |