diff options
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f8da28278014..4c011ec69ed4 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -112,9 +112,6 @@ | |||
112 | #define RT_FL_TOS(oldflp4) \ | 112 | #define RT_FL_TOS(oldflp4) \ |
113 | ((oldflp4)->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK)) | 113 | ((oldflp4)->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK)) |
114 | 114 | ||
115 | /* IPv4 datagram length is stored into 16bit field (tot_len) */ | ||
116 | #define IP_MAX_MTU 0xFFFF | ||
117 | |||
118 | #define RT_GC_TIMEOUT (300*HZ) | 115 | #define RT_GC_TIMEOUT (300*HZ) |
119 | 116 | ||
120 | static int ip_rt_max_size; | 117 | static int ip_rt_max_size; |
@@ -1600,6 +1597,7 @@ static int __mkroute_input(struct sk_buff *skb, | |||
1600 | rth->rt_gateway = 0; | 1597 | rth->rt_gateway = 0; |
1601 | rth->rt_uses_gateway = 0; | 1598 | rth->rt_uses_gateway = 0; |
1602 | INIT_LIST_HEAD(&rth->rt_uncached); | 1599 | INIT_LIST_HEAD(&rth->rt_uncached); |
1600 | RT_CACHE_STAT_INC(in_slow_tot); | ||
1603 | 1601 | ||
1604 | rth->dst.input = ip_forward; | 1602 | rth->dst.input = ip_forward; |
1605 | rth->dst.output = ip_output; | 1603 | rth->dst.output = ip_output; |
@@ -1698,10 +1696,11 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1698 | fl4.daddr = daddr; | 1696 | fl4.daddr = daddr; |
1699 | fl4.saddr = saddr; | 1697 | fl4.saddr = saddr; |
1700 | err = fib_lookup(net, &fl4, &res); | 1698 | err = fib_lookup(net, &fl4, &res); |
1701 | if (err != 0) | 1699 | if (err != 0) { |
1700 | if (!IN_DEV_FORWARD(in_dev)) | ||
1701 | err = -EHOSTUNREACH; | ||
1702 | goto no_route; | 1702 | goto no_route; |
1703 | 1703 | } | |
1704 | RT_CACHE_STAT_INC(in_slow_tot); | ||
1705 | 1704 | ||
1706 | if (res.type == RTN_BROADCAST) | 1705 | if (res.type == RTN_BROADCAST) |
1707 | goto brd_input; | 1706 | goto brd_input; |
@@ -1715,8 +1714,10 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1715 | goto local_input; | 1714 | goto local_input; |
1716 | } | 1715 | } |
1717 | 1716 | ||
1718 | if (!IN_DEV_FORWARD(in_dev)) | 1717 | if (!IN_DEV_FORWARD(in_dev)) { |
1718 | err = -EHOSTUNREACH; | ||
1719 | goto no_route; | 1719 | goto no_route; |
1720 | } | ||
1720 | if (res.type != RTN_UNICAST) | 1721 | if (res.type != RTN_UNICAST) |
1721 | goto martian_destination; | 1722 | goto martian_destination; |
1722 | 1723 | ||
@@ -1771,6 +1772,7 @@ local_input: | |||
1771 | rth->rt_gateway = 0; | 1772 | rth->rt_gateway = 0; |
1772 | rth->rt_uses_gateway = 0; | 1773 | rth->rt_uses_gateway = 0; |
1773 | INIT_LIST_HEAD(&rth->rt_uncached); | 1774 | INIT_LIST_HEAD(&rth->rt_uncached); |
1775 | RT_CACHE_STAT_INC(in_slow_tot); | ||
1774 | if (res.type == RTN_UNREACHABLE) { | 1776 | if (res.type == RTN_UNREACHABLE) { |
1775 | rth->dst.input= ip_error; | 1777 | rth->dst.input= ip_error; |
1776 | rth->dst.error= -err; | 1778 | rth->dst.error= -err; |