aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2011-12-02 06:39:42 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-03 01:32:23 -0500
commitf61759e6b831a55b89e584b198c3da325e2bc379 (patch)
tree5fe945faa11f90ea10ec54bf4cbf76044945de13 /net
parent5983fe2b29df5885880d7fa3b91aca306c7564ef (diff)
ipv4: make sure RTO_ONLINK is saved in routing cache
__mkroute_output fails to work with the original tos and uses value with stripped RTO_ONLINK bit. Make sure we put the original TOS bits into rt_key_tos because it used to match cached route. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ca5e237df029..588d971a3ba1 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -112,7 +112,7 @@
112#include <net/secure_seq.h> 112#include <net/secure_seq.h>
113 113
114#define RT_FL_TOS(oldflp4) \ 114#define RT_FL_TOS(oldflp4) \
115 ((u32)(oldflp4->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK))) 115 ((oldflp4)->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK))
116 116
117#define IP_MAX_MTU 0xFFF0 117#define IP_MAX_MTU 0xFFF0
118 118
@@ -2441,11 +2441,11 @@ EXPORT_SYMBOL(ip_route_input_common);
2441static struct rtable *__mkroute_output(const struct fib_result *res, 2441static struct rtable *__mkroute_output(const struct fib_result *res,
2442 const struct flowi4 *fl4, 2442 const struct flowi4 *fl4,
2443 __be32 orig_daddr, __be32 orig_saddr, 2443 __be32 orig_daddr, __be32 orig_saddr,
2444 int orig_oif, struct net_device *dev_out, 2444 int orig_oif, __u8 orig_rtos,
2445 struct net_device *dev_out,
2445 unsigned int flags) 2446 unsigned int flags)
2446{ 2447{
2447 struct fib_info *fi = res->fi; 2448 struct fib_info *fi = res->fi;
2448 u32 tos = RT_FL_TOS(fl4);
2449 struct in_device *in_dev; 2449 struct in_device *in_dev;
2450 u16 type = res->type; 2450 u16 type = res->type;
2451 struct rtable *rth; 2451 struct rtable *rth;
@@ -2496,7 +2496,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2496 rth->rt_genid = rt_genid(dev_net(dev_out)); 2496 rth->rt_genid = rt_genid(dev_net(dev_out));
2497 rth->rt_flags = flags; 2497 rth->rt_flags = flags;
2498 rth->rt_type = type; 2498 rth->rt_type = type;
2499 rth->rt_key_tos = tos; 2499 rth->rt_key_tos = orig_rtos;
2500 rth->rt_dst = fl4->daddr; 2500 rth->rt_dst = fl4->daddr;
2501 rth->rt_src = fl4->saddr; 2501 rth->rt_src = fl4->saddr;
2502 rth->rt_route_iif = 0; 2502 rth->rt_route_iif = 0;
@@ -2546,7 +2546,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
2546static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4) 2546static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
2547{ 2547{
2548 struct net_device *dev_out = NULL; 2548 struct net_device *dev_out = NULL;
2549 u32 tos = RT_FL_TOS(fl4); 2549 __u8 tos = RT_FL_TOS(fl4);
2550 unsigned int flags = 0; 2550 unsigned int flags = 0;
2551 struct fib_result res; 2551 struct fib_result res;
2552 struct rtable *rth; 2552 struct rtable *rth;
@@ -2722,7 +2722,7 @@ static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
2722 2722
2723make_route: 2723make_route:
2724 rth = __mkroute_output(&res, fl4, orig_daddr, orig_saddr, orig_oif, 2724 rth = __mkroute_output(&res, fl4, orig_daddr, orig_saddr, orig_oif,
2725 dev_out, flags); 2725 tos, dev_out, flags);
2726 if (!IS_ERR(rth)) { 2726 if (!IS_ERR(rth)) {
2727 unsigned int hash; 2727 unsigned int hash;
2728 2728