diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 16:22:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:54 -0500 |
commit | 4c9483b2fb5d2548c3cc1fe03cdd4484ceeb5d1c (patch) | |
tree | c29c8070012cffb38fe249cf528589a675f622b1 /net/ipv6/ip6mr.c | |
parent | 9cce96df5b76691712dba22e83ff5efe900361e1 (diff) |
ipv6: Convert to use flowi6 where applicable.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r-- | net/ipv6/ip6mr.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 61a8be3ac4e4..7ff0343e05c7 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -135,14 +135,15 @@ static struct mr6_table *ip6mr_get_table(struct net *net, u32 id) | |||
135 | return NULL; | 135 | return NULL; |
136 | } | 136 | } |
137 | 137 | ||
138 | static int ip6mr_fib_lookup(struct net *net, struct flowi *flp, | 138 | static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6, |
139 | struct mr6_table **mrt) | 139 | struct mr6_table **mrt) |
140 | { | 140 | { |
141 | struct ip6mr_result res; | 141 | struct ip6mr_result res; |
142 | struct fib_lookup_arg arg = { .result = &res, }; | 142 | struct fib_lookup_arg arg = { .result = &res, }; |
143 | int err; | 143 | int err; |
144 | 144 | ||
145 | err = fib_rules_lookup(net->ipv6.mr6_rules_ops, flp, 0, &arg); | 145 | err = fib_rules_lookup(net->ipv6.mr6_rules_ops, |
146 | flowi6_to_flowi(flp6), 0, &arg); | ||
146 | if (err < 0) | 147 | if (err < 0) |
147 | return err; | 148 | return err; |
148 | *mrt = res.mrt; | 149 | *mrt = res.mrt; |
@@ -270,7 +271,7 @@ static struct mr6_table *ip6mr_get_table(struct net *net, u32 id) | |||
270 | return net->ipv6.mrt6; | 271 | return net->ipv6.mrt6; |
271 | } | 272 | } |
272 | 273 | ||
273 | static int ip6mr_fib_lookup(struct net *net, struct flowi *flp, | 274 | static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6, |
274 | struct mr6_table **mrt) | 275 | struct mr6_table **mrt) |
275 | { | 276 | { |
276 | *mrt = net->ipv6.mrt6; | 277 | *mrt = net->ipv6.mrt6; |
@@ -617,9 +618,9 @@ static int pim6_rcv(struct sk_buff *skb) | |||
617 | struct net_device *reg_dev = NULL; | 618 | struct net_device *reg_dev = NULL; |
618 | struct net *net = dev_net(skb->dev); | 619 | struct net *net = dev_net(skb->dev); |
619 | struct mr6_table *mrt; | 620 | struct mr6_table *mrt; |
620 | struct flowi fl = { | 621 | struct flowi6 fl6 = { |
621 | .flowi_iif = skb->dev->ifindex, | 622 | .flowi6_iif = skb->dev->ifindex, |
622 | .flowi_mark = skb->mark, | 623 | .flowi6_mark = skb->mark, |
623 | }; | 624 | }; |
624 | int reg_vif_num; | 625 | int reg_vif_num; |
625 | 626 | ||
@@ -644,7 +645,7 @@ static int pim6_rcv(struct sk_buff *skb) | |||
644 | ntohs(encap->payload_len) + sizeof(*pim) > skb->len) | 645 | ntohs(encap->payload_len) + sizeof(*pim) > skb->len) |
645 | goto drop; | 646 | goto drop; |
646 | 647 | ||
647 | if (ip6mr_fib_lookup(net, &fl, &mrt) < 0) | 648 | if (ip6mr_fib_lookup(net, &fl6, &mrt) < 0) |
648 | goto drop; | 649 | goto drop; |
649 | reg_vif_num = mrt->mroute_reg_vif_num; | 650 | reg_vif_num = mrt->mroute_reg_vif_num; |
650 | 651 | ||
@@ -687,14 +688,14 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, | |||
687 | { | 688 | { |
688 | struct net *net = dev_net(dev); | 689 | struct net *net = dev_net(dev); |
689 | struct mr6_table *mrt; | 690 | struct mr6_table *mrt; |
690 | struct flowi fl = { | 691 | struct flowi6 fl6 = { |
691 | .flowi_oif = dev->ifindex, | 692 | .flowi6_oif = dev->ifindex, |
692 | .flowi_iif = skb->skb_iif, | 693 | .flowi6_iif = skb->skb_iif, |
693 | .flowi_mark = skb->mark, | 694 | .flowi6_mark = skb->mark, |
694 | }; | 695 | }; |
695 | int err; | 696 | int err; |
696 | 697 | ||
697 | err = ip6mr_fib_lookup(net, &fl, &mrt); | 698 | err = ip6mr_fib_lookup(net, &fl6, &mrt); |
698 | if (err < 0) | 699 | if (err < 0) |
699 | return err; | 700 | return err; |
700 | 701 | ||
@@ -1547,13 +1548,13 @@ int ip6mr_sk_done(struct sock *sk) | |||
1547 | struct sock *mroute6_socket(struct net *net, struct sk_buff *skb) | 1548 | struct sock *mroute6_socket(struct net *net, struct sk_buff *skb) |
1548 | { | 1549 | { |
1549 | struct mr6_table *mrt; | 1550 | struct mr6_table *mrt; |
1550 | struct flowi fl = { | 1551 | struct flowi6 fl6 = { |
1551 | .flowi_iif = skb->skb_iif, | 1552 | .flowi6_iif = skb->skb_iif, |
1552 | .flowi_oif = skb->dev->ifindex, | 1553 | .flowi6_oif = skb->dev->ifindex, |
1553 | .flowi_mark= skb->mark, | 1554 | .flowi6_mark = skb->mark, |
1554 | }; | 1555 | }; |
1555 | 1556 | ||
1556 | if (ip6mr_fib_lookup(net, &fl, &mrt) < 0) | 1557 | if (ip6mr_fib_lookup(net, &fl6, &mrt) < 0) |
1557 | return NULL; | 1558 | return NULL; |
1558 | 1559 | ||
1559 | return mrt->mroute6_sk; | 1560 | return mrt->mroute6_sk; |
@@ -1897,7 +1898,7 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt, | |||
1897 | struct mif_device *vif = &mrt->vif6_table[vifi]; | 1898 | struct mif_device *vif = &mrt->vif6_table[vifi]; |
1898 | struct net_device *dev; | 1899 | struct net_device *dev; |
1899 | struct dst_entry *dst; | 1900 | struct dst_entry *dst; |
1900 | struct flowi fl; | 1901 | struct flowi6 fl6; |
1901 | 1902 | ||
1902 | if (vif->dev == NULL) | 1903 | if (vif->dev == NULL) |
1903 | goto out_free; | 1904 | goto out_free; |
@@ -1915,12 +1916,12 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt, | |||
1915 | 1916 | ||
1916 | ipv6h = ipv6_hdr(skb); | 1917 | ipv6h = ipv6_hdr(skb); |
1917 | 1918 | ||
1918 | fl = (struct flowi) { | 1919 | fl6 = (struct flowi6) { |
1919 | .flowi_oif = vif->link, | 1920 | .flowi6_oif = vif->link, |
1920 | .fl6_dst = ipv6h->daddr, | 1921 | .daddr = ipv6h->daddr, |
1921 | }; | 1922 | }; |
1922 | 1923 | ||
1923 | dst = ip6_route_output(net, NULL, &fl); | 1924 | dst = ip6_route_output(net, NULL, &fl6); |
1924 | if (!dst) | 1925 | if (!dst) |
1925 | goto out_free; | 1926 | goto out_free; |
1926 | 1927 | ||
@@ -2043,13 +2044,13 @@ int ip6_mr_input(struct sk_buff *skb) | |||
2043 | struct mfc6_cache *cache; | 2044 | struct mfc6_cache *cache; |
2044 | struct net *net = dev_net(skb->dev); | 2045 | struct net *net = dev_net(skb->dev); |
2045 | struct mr6_table *mrt; | 2046 | struct mr6_table *mrt; |
2046 | struct flowi fl = { | 2047 | struct flowi6 fl6 = { |
2047 | .flowi_iif = skb->dev->ifindex, | 2048 | .flowi6_iif = skb->dev->ifindex, |
2048 | .flowi_mark= skb->mark, | 2049 | .flowi6_mark = skb->mark, |
2049 | }; | 2050 | }; |
2050 | int err; | 2051 | int err; |
2051 | 2052 | ||
2052 | err = ip6mr_fib_lookup(net, &fl, &mrt); | 2053 | err = ip6mr_fib_lookup(net, &fl6, &mrt); |
2053 | if (err < 0) | 2054 | if (err < 0) |
2054 | return err; | 2055 | return err; |
2055 | 2056 | ||