diff options
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 9e938f95cea8..5655095a89e0 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2626,7 +2626,7 @@ out: | |||
2626 | return rth; | 2626 | return rth; |
2627 | } | 2627 | } |
2628 | 2628 | ||
2629 | struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp) | 2629 | struct rtable *__ip_route_output_key(struct net *net, const struct flowi4 *flp4) |
2630 | { | 2630 | { |
2631 | struct rtable *rth; | 2631 | struct rtable *rth; |
2632 | unsigned int hash; | 2632 | unsigned int hash; |
@@ -2634,17 +2634,17 @@ struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp) | |||
2634 | if (!rt_caching(net)) | 2634 | if (!rt_caching(net)) |
2635 | goto slow_output; | 2635 | goto slow_output; |
2636 | 2636 | ||
2637 | hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->flowi_oif, rt_genid(net)); | 2637 | hash = rt_hash(flp4->daddr, flp4->saddr, flp4->flowi4_oif, rt_genid(net)); |
2638 | 2638 | ||
2639 | rcu_read_lock_bh(); | 2639 | rcu_read_lock_bh(); |
2640 | for (rth = rcu_dereference_bh(rt_hash_table[hash].chain); rth; | 2640 | for (rth = rcu_dereference_bh(rt_hash_table[hash].chain); rth; |
2641 | rth = rcu_dereference_bh(rth->dst.rt_next)) { | 2641 | rth = rcu_dereference_bh(rth->dst.rt_next)) { |
2642 | if (rth->rt_key_dst == flp->fl4_dst && | 2642 | if (rth->rt_key_dst == flp4->daddr && |
2643 | rth->rt_key_src == flp->fl4_src && | 2643 | rth->rt_key_src == flp4->saddr && |
2644 | rt_is_output_route(rth) && | 2644 | rt_is_output_route(rth) && |
2645 | rth->rt_oif == flp->flowi_oif && | 2645 | rth->rt_oif == flp4->flowi4_oif && |
2646 | rth->rt_mark == flp->flowi_mark && | 2646 | rth->rt_mark == flp4->flowi4_mark && |
2647 | !((rth->rt_tos ^ flp->fl4_tos) & | 2647 | !((rth->rt_tos ^ flp4->flowi4_tos) & |
2648 | (IPTOS_RT_MASK | RTO_ONLINK)) && | 2648 | (IPTOS_RT_MASK | RTO_ONLINK)) && |
2649 | net_eq(dev_net(rth->dst.dev), net) && | 2649 | net_eq(dev_net(rth->dst.dev), net) && |
2650 | !rt_is_expired(rth)) { | 2650 | !rt_is_expired(rth)) { |
@@ -2658,7 +2658,7 @@ struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp) | |||
2658 | rcu_read_unlock_bh(); | 2658 | rcu_read_unlock_bh(); |
2659 | 2659 | ||
2660 | slow_output: | 2660 | slow_output: |
2661 | return ip_route_output_slow(net, &flp->u.ip4); | 2661 | return ip_route_output_slow(net, flp4); |
2662 | } | 2662 | } |
2663 | EXPORT_SYMBOL_GPL(__ip_route_output_key); | 2663 | EXPORT_SYMBOL_GPL(__ip_route_output_key); |
2664 | 2664 | ||
@@ -2733,20 +2733,22 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or | |||
2733 | return rt ? &rt->dst : ERR_PTR(-ENOMEM); | 2733 | return rt ? &rt->dst : ERR_PTR(-ENOMEM); |
2734 | } | 2734 | } |
2735 | 2735 | ||
2736 | struct rtable *ip_route_output_flow(struct net *net, struct flowi *flp, | 2736 | struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4, |
2737 | struct sock *sk) | 2737 | struct sock *sk) |
2738 | { | 2738 | { |
2739 | struct rtable *rt = __ip_route_output_key(net, flp); | 2739 | struct rtable *rt = __ip_route_output_key(net, flp4); |
2740 | 2740 | ||
2741 | if (IS_ERR(rt)) | 2741 | if (IS_ERR(rt)) |
2742 | return rt; | 2742 | return rt; |
2743 | 2743 | ||
2744 | if (flp->flowi_proto) { | 2744 | if (flp4->flowi4_proto) { |
2745 | if (!flp->fl4_src) | 2745 | if (!flp4->saddr) |
2746 | flp->fl4_src = rt->rt_src; | 2746 | flp4->saddr = rt->rt_src; |
2747 | if (!flp->fl4_dst) | 2747 | if (!flp4->daddr) |
2748 | flp->fl4_dst = rt->rt_dst; | 2748 | flp4->daddr = rt->rt_dst; |
2749 | rt = (struct rtable *) xfrm_lookup(net, &rt->dst, flp, sk, 0); | 2749 | rt = (struct rtable *) xfrm_lookup(net, &rt->dst, |
2750 | flowi4_to_flowi(flp4), | ||
2751 | sk, 0); | ||
2750 | } | 2752 | } |
2751 | 2753 | ||
2752 | return rt; | 2754 | return rt; |
@@ -2920,7 +2922,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void | |||
2920 | .flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0, | 2922 | .flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0, |
2921 | .flowi4_mark = mark, | 2923 | .flowi4_mark = mark, |
2922 | }; | 2924 | }; |
2923 | rt = ip_route_output_key(net, flowi4_to_flowi(&fl4)); | 2925 | rt = ip_route_output_key(net, &fl4); |
2924 | 2926 | ||
2925 | err = 0; | 2927 | err = 0; |
2926 | if (IS_ERR(rt)) | 2928 | if (IS_ERR(rt)) |