aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9c17e32d5623..c9aa4f9effe2 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1701,9 +1701,9 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
1701 .fl4_dst = rt->rt_key_dst, 1701 .fl4_dst = rt->rt_key_dst,
1702 .fl4_src = rt->rt_key_src, 1702 .fl4_src = rt->rt_key_src,
1703 .fl4_tos = rt->rt_tos, 1703 .fl4_tos = rt->rt_tos,
1704 .oif = rt->rt_oif, 1704 .flowi_oif = rt->rt_oif,
1705 .iif = rt->rt_iif, 1705 .flowi_iif = rt->rt_iif,
1706 .mark = rt->rt_mark, 1706 .flowi_mark = rt->rt_mark,
1707 }; 1707 };
1708 1708
1709 rcu_read_lock(); 1709 rcu_read_lock();
@@ -1766,7 +1766,7 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi *oldflp,
1766 /* If a peer entry exists for this destination, we must hook 1766 /* If a peer entry exists for this destination, we must hook
1767 * it up in order to get at cached metrics. 1767 * it up in order to get at cached metrics.
1768 */ 1768 */
1769 if (oldflp && (oldflp->flags & FLOWI_FLAG_PRECOW_METRICS)) 1769 if (oldflp && (oldflp->flowi_flags & FLOWI_FLAG_PRECOW_METRICS))
1770 create = 1; 1770 create = 1;
1771 1771
1772 rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create); 1772 rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
@@ -2057,9 +2057,9 @@ static int ip_mkroute_input(struct sk_buff *skb,
2057 return err; 2057 return err;
2058 2058
2059 /* put it into the cache */ 2059 /* put it into the cache */
2060 hash = rt_hash(daddr, saddr, fl->iif, 2060 hash = rt_hash(daddr, saddr, fl->flowi_iif,
2061 rt_genid(dev_net(rth->dst.dev))); 2061 rt_genid(dev_net(rth->dst.dev)));
2062 rth = rt_intern_hash(hash, rth, skb, fl->iif); 2062 rth = rt_intern_hash(hash, rth, skb, fl->flowi_iif);
2063 if (IS_ERR(rth)) 2063 if (IS_ERR(rth))
2064 return PTR_ERR(rth); 2064 return PTR_ERR(rth);
2065 return 0; 2065 return 0;
@@ -2118,9 +2118,9 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
2118 /* 2118 /*
2119 * Now we are ready to route packet. 2119 * Now we are ready to route packet.
2120 */ 2120 */
2121 fl.oif = 0; 2121 fl.flowi_oif = 0;
2122 fl.iif = dev->ifindex; 2122 fl.flowi_iif = dev->ifindex;
2123 fl.mark = skb->mark; 2123 fl.flowi_mark = skb->mark;
2124 fl.fl4_dst = daddr; 2124 fl.fl4_dst = daddr;
2125 fl.fl4_src = saddr; 2125 fl.fl4_src = saddr;
2126 fl.fl4_tos = tos; 2126 fl.fl4_tos = tos;
@@ -2205,8 +2205,8 @@ local_input:
2205 rth->rt_flags &= ~RTCF_LOCAL; 2205 rth->rt_flags &= ~RTCF_LOCAL;
2206 } 2206 }
2207 rth->rt_type = res.type; 2207 rth->rt_type = res.type;
2208 hash = rt_hash(daddr, saddr, fl.iif, rt_genid(net)); 2208 hash = rt_hash(daddr, saddr, fl.flowi_iif, rt_genid(net));
2209 rth = rt_intern_hash(hash, rth, skb, fl.iif); 2209 rth = rt_intern_hash(hash, rth, skb, fl.flowi_iif);
2210 err = 0; 2210 err = 0;
2211 if (IS_ERR(rth)) 2211 if (IS_ERR(rth))
2212 err = PTR_ERR(rth); 2212 err = PTR_ERR(rth);
@@ -2369,7 +2369,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2369 } else if (type == RTN_MULTICAST) { 2369 } else if (type == RTN_MULTICAST) {
2370 flags |= RTCF_MULTICAST | RTCF_LOCAL; 2370 flags |= RTCF_MULTICAST | RTCF_LOCAL;
2371 if (!ip_check_mc_rcu(in_dev, oldflp->fl4_dst, oldflp->fl4_src, 2371 if (!ip_check_mc_rcu(in_dev, oldflp->fl4_dst, oldflp->fl4_src,
2372 oldflp->proto)) 2372 oldflp->flowi_proto))
2373 flags &= ~RTCF_LOCAL; 2373 flags &= ~RTCF_LOCAL;
2374 /* If multicast route do not exist use 2374 /* If multicast route do not exist use
2375 * default one, but do not gateway in this case. 2375 * default one, but do not gateway in this case.
@@ -2387,8 +2387,8 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2387 rth->rt_key_dst = oldflp->fl4_dst; 2387 rth->rt_key_dst = oldflp->fl4_dst;
2388 rth->rt_tos = tos; 2388 rth->rt_tos = tos;
2389 rth->rt_key_src = oldflp->fl4_src; 2389 rth->rt_key_src = oldflp->fl4_src;
2390 rth->rt_oif = oldflp->oif; 2390 rth->rt_oif = oldflp->flowi_oif;
2391 rth->rt_mark = oldflp->mark; 2391 rth->rt_mark = oldflp->flowi_mark;
2392 rth->rt_dst = fl->fl4_dst; 2392 rth->rt_dst = fl->fl4_dst;
2393 rth->rt_src = fl->fl4_src; 2393 rth->rt_src = fl->fl4_src;
2394 rth->rt_iif = 0; 2394 rth->rt_iif = 0;
@@ -2452,9 +2452,9 @@ static struct rtable *ip_route_output_slow(struct net *net,
2452 res.r = NULL; 2452 res.r = NULL;
2453#endif 2453#endif
2454 2454
2455 fl.oif = oldflp->oif; 2455 fl.flowi_oif = oldflp->flowi_oif;
2456 fl.iif = net->loopback_dev->ifindex; 2456 fl.flowi_iif = net->loopback_dev->ifindex;
2457 fl.mark = oldflp->mark; 2457 fl.flowi_mark = oldflp->flowi_mark;
2458 fl.fl4_dst = oldflp->fl4_dst; 2458 fl.fl4_dst = oldflp->fl4_dst;
2459 fl.fl4_src = oldflp->fl4_src; 2459 fl.fl4_src = oldflp->fl4_src;
2460 fl.fl4_tos = tos & IPTOS_RT_MASK; 2460 fl.fl4_tos = tos & IPTOS_RT_MASK;
@@ -2477,7 +2477,7 @@ static struct rtable *ip_route_output_slow(struct net *net,
2477 of another iface. --ANK 2477 of another iface. --ANK
2478 */ 2478 */
2479 2479
2480 if (oldflp->oif == 0 && 2480 if (oldflp->flowi_oif == 0 &&
2481 (ipv4_is_multicast(oldflp->fl4_dst) || 2481 (ipv4_is_multicast(oldflp->fl4_dst) ||
2482 ipv4_is_lbcast(oldflp->fl4_dst))) { 2482 ipv4_is_lbcast(oldflp->fl4_dst))) {
2483 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ 2483 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
@@ -2500,11 +2500,11 @@ static struct rtable *ip_route_output_slow(struct net *net,
2500 Luckily, this hack is good workaround. 2500 Luckily, this hack is good workaround.
2501 */ 2501 */
2502 2502
2503 fl.oif = dev_out->ifindex; 2503 fl.flowi_oif = dev_out->ifindex;
2504 goto make_route; 2504 goto make_route;
2505 } 2505 }
2506 2506
2507 if (!(oldflp->flags & FLOWI_FLAG_ANYSRC)) { 2507 if (!(oldflp->flowi_flags & FLOWI_FLAG_ANYSRC)) {
2508 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */ 2508 /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
2509 if (!__ip_dev_find(net, oldflp->fl4_src, false)) 2509 if (!__ip_dev_find(net, oldflp->fl4_src, false))
2510 goto out; 2510 goto out;
@@ -2512,8 +2512,8 @@ static struct rtable *ip_route_output_slow(struct net *net,
2512 } 2512 }
2513 2513
2514 2514
2515 if (oldflp->oif) { 2515 if (oldflp->flowi_oif) {
2516 dev_out = dev_get_by_index_rcu(net, oldflp->oif); 2516 dev_out = dev_get_by_index_rcu(net, oldflp->flowi_oif);
2517 rth = ERR_PTR(-ENODEV); 2517 rth = ERR_PTR(-ENODEV);
2518 if (dev_out == NULL) 2518 if (dev_out == NULL)
2519 goto out; 2519 goto out;
@@ -2545,7 +2545,7 @@ static struct rtable *ip_route_output_slow(struct net *net,
2545 if (!fl.fl4_dst) 2545 if (!fl.fl4_dst)
2546 fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK); 2546 fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK);
2547 dev_out = net->loopback_dev; 2547 dev_out = net->loopback_dev;
2548 fl.oif = net->loopback_dev->ifindex; 2548 fl.flowi_oif = net->loopback_dev->ifindex;
2549 res.type = RTN_LOCAL; 2549 res.type = RTN_LOCAL;
2550 flags |= RTCF_LOCAL; 2550 flags |= RTCF_LOCAL;
2551 goto make_route; 2551 goto make_route;
@@ -2553,7 +2553,7 @@ static struct rtable *ip_route_output_slow(struct net *net,
2553 2553
2554 if (fib_lookup(net, &fl, &res)) { 2554 if (fib_lookup(net, &fl, &res)) {
2555 res.fi = NULL; 2555 res.fi = NULL;
2556 if (oldflp->oif) { 2556 if (oldflp->flowi_oif) {
2557 /* Apparently, routing tables are wrong. Assume, 2557 /* Apparently, routing tables are wrong. Assume,
2558 that the destination is on link. 2558 that the destination is on link.
2559 2559
@@ -2590,25 +2590,25 @@ static struct rtable *ip_route_output_slow(struct net *net,
2590 fl.fl4_src = fl.fl4_dst; 2590 fl.fl4_src = fl.fl4_dst;
2591 } 2591 }
2592 dev_out = net->loopback_dev; 2592 dev_out = net->loopback_dev;
2593 fl.oif = dev_out->ifindex; 2593 fl.flowi_oif = dev_out->ifindex;
2594 res.fi = NULL; 2594 res.fi = NULL;
2595 flags |= RTCF_LOCAL; 2595 flags |= RTCF_LOCAL;
2596 goto make_route; 2596 goto make_route;
2597 } 2597 }
2598 2598
2599#ifdef CONFIG_IP_ROUTE_MULTIPATH 2599#ifdef CONFIG_IP_ROUTE_MULTIPATH
2600 if (res.fi->fib_nhs > 1 && fl.oif == 0) 2600 if (res.fi->fib_nhs > 1 && fl.flowi_oif == 0)
2601 fib_select_multipath(&res); 2601 fib_select_multipath(&res);
2602 else 2602 else
2603#endif 2603#endif
2604 if (!res.prefixlen && res.type == RTN_UNICAST && !fl.oif) 2604 if (!res.prefixlen && res.type == RTN_UNICAST && !fl.flowi_oif)
2605 fib_select_default(&res); 2605 fib_select_default(&res);
2606 2606
2607 if (!fl.fl4_src) 2607 if (!fl.fl4_src)
2608 fl.fl4_src = FIB_RES_PREFSRC(res); 2608 fl.fl4_src = FIB_RES_PREFSRC(res);
2609 2609
2610 dev_out = FIB_RES_DEV(res); 2610 dev_out = FIB_RES_DEV(res);
2611 fl.oif = dev_out->ifindex; 2611 fl.flowi_oif = dev_out->ifindex;
2612 2612
2613 2613
2614make_route: 2614make_route:
@@ -2616,9 +2616,9 @@ make_route:
2616 if (!IS_ERR(rth)) { 2616 if (!IS_ERR(rth)) {
2617 unsigned int hash; 2617 unsigned int hash;
2618 2618
2619 hash = rt_hash(oldflp->fl4_dst, oldflp->fl4_src, oldflp->oif, 2619 hash = rt_hash(oldflp->fl4_dst, oldflp->fl4_src, oldflp->flowi_oif,
2620 rt_genid(dev_net(dev_out))); 2620 rt_genid(dev_net(dev_out)));
2621 rth = rt_intern_hash(hash, rth, NULL, oldflp->oif); 2621 rth = rt_intern_hash(hash, rth, NULL, oldflp->flowi_oif);
2622 } 2622 }
2623 2623
2624out: 2624out:
@@ -2634,7 +2634,7 @@ 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->oif, rt_genid(net)); 2637 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->flowi_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;
@@ -2642,8 +2642,8 @@ struct rtable *__ip_route_output_key(struct net *net, const struct flowi *flp)
2642 if (rth->rt_key_dst == flp->fl4_dst && 2642 if (rth->rt_key_dst == flp->fl4_dst &&
2643 rth->rt_key_src == flp->fl4_src && 2643 rth->rt_key_src == flp->fl4_src &&
2644 rt_is_output_route(rth) && 2644 rt_is_output_route(rth) &&
2645 rth->rt_oif == flp->oif && 2645 rth->rt_oif == flp->flowi_oif &&
2646 rth->rt_mark == flp->mark && 2646 rth->rt_mark == flp->flowi_mark &&
2647 !((rth->rt_tos ^ flp->fl4_tos) & 2647 !((rth->rt_tos ^ flp->fl4_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) &&
@@ -2741,7 +2741,7 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi *flp,
2741 if (IS_ERR(rt)) 2741 if (IS_ERR(rt))
2742 return rt; 2742 return rt;
2743 2743
2744 if (flp->proto) { 2744 if (flp->flowi_proto) {
2745 if (!flp->fl4_src) 2745 if (!flp->fl4_src)
2746 flp->fl4_src = rt->rt_src; 2746 flp->fl4_src = rt->rt_src;
2747 if (!flp->fl4_dst) 2747 if (!flp->fl4_dst)
@@ -2917,8 +2917,8 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2917 .fl4_dst = dst, 2917 .fl4_dst = dst,
2918 .fl4_src = src, 2918 .fl4_src = src,
2919 .fl4_tos = rtm->rtm_tos, 2919 .fl4_tos = rtm->rtm_tos,
2920 .oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0, 2920 .flowi_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0,
2921 .mark = mark, 2921 .flowi_mark = mark,
2922 }; 2922 };
2923 rt = ip_route_output_key(net, &fl); 2923 rt = ip_route_output_key(net, &fl);
2924 2924