diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 12bba0880345..48534c6c0735 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -109,7 +109,7 @@ static struct dst_ops ip6_dst_ops_template = { | |||
109 | .negative_advice = ip6_negative_advice, | 109 | .negative_advice = ip6_negative_advice, |
110 | .link_failure = ip6_link_failure, | 110 | .link_failure = ip6_link_failure, |
111 | .update_pmtu = ip6_rt_update_pmtu, | 111 | .update_pmtu = ip6_rt_update_pmtu, |
112 | .local_out = ip6_local_out, | 112 | .local_out = __ip6_local_out, |
113 | .entry_size = sizeof(struct rt6_info), | 113 | .entry_size = sizeof(struct rt6_info), |
114 | .entries = ATOMIC_INIT(0), | 114 | .entries = ATOMIC_INIT(0), |
115 | }; | 115 | }; |
@@ -475,7 +475,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, | |||
475 | lifetime = ntohl(rinfo->lifetime); | 475 | lifetime = ntohl(rinfo->lifetime); |
476 | if (lifetime == 0xffffffff) { | 476 | if (lifetime == 0xffffffff) { |
477 | /* infinity */ | 477 | /* infinity */ |
478 | } else if (lifetime > 0x7fffffff/HZ) { | 478 | } else if (lifetime > 0x7fffffff/HZ - 1) { |
479 | /* Avoid arithmetic overflow */ | 479 | /* Avoid arithmetic overflow */ |
480 | lifetime = 0x7fffffff/HZ - 1; | 480 | lifetime = 0x7fffffff/HZ - 1; |
481 | } | 481 | } |
@@ -1106,7 +1106,9 @@ int ip6_route_add(struct fib6_config *cfg) | |||
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | rt->u.dst.obsolete = -1; | 1108 | rt->u.dst.obsolete = -1; |
1109 | rt->rt6i_expires = jiffies + clock_t_to_jiffies(cfg->fc_expires); | 1109 | rt->rt6i_expires = (cfg->fc_flags & RTF_EXPIRES) ? |
1110 | jiffies + clock_t_to_jiffies(cfg->fc_expires) : | ||
1111 | 0; | ||
1110 | 1112 | ||
1111 | if (cfg->fc_protocol == RTPROT_UNSPEC) | 1113 | if (cfg->fc_protocol == RTPROT_UNSPEC) |
1112 | cfg->fc_protocol = RTPROT_BOOT; | 1114 | cfg->fc_protocol = RTPROT_BOOT; |
@@ -2200,7 +2202,9 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, | |||
2200 | 2202 | ||
2201 | NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric); | 2203 | NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric); |
2202 | 2204 | ||
2203 | expires = rt->rt6i_expires ? rt->rt6i_expires - jiffies : 0; | 2205 | expires = (rt->rt6i_flags & RTF_EXPIRES) ? |
2206 | rt->rt6i_expires - jiffies : 0; | ||
2207 | |||
2204 | if (rtnl_put_cacheinfo(skb, &rt->u.dst, 0, 0, 0, | 2208 | if (rtnl_put_cacheinfo(skb, &rt->u.dst, 0, 0, 0, |
2205 | expires, rt->u.dst.error) < 0) | 2209 | expires, rt->u.dst.error) < 0) |
2206 | goto nla_put_failure; | 2210 | goto nla_put_failure; |