• Li Wei's avatar
    ipv6: fix incorrect route 'expires' value passed to userspace · 8253947e
    Li Wei authored
    When userspace use RTM_GETROUTE to dump route table, with an already
    expired route entry, we always got an 'expires' value(2147157)
    calculated base on INT_MAX.
    
    The reason of this problem is in the following satement:
    	rt->dst.expires - jiffies < INT_MAX
    gcc promoted the type of both sides of '<' to unsigned long, thus
    a small negative value would be considered greater than INT_MAX.
    
    With the help of Eric Dumazet, do the out of bound checks in
    rtnl_put_cacheinfo(), _after_ conversion to clock_t.
    Signed-off-by: default avatarLi Wei <lw@cn.fujitsu.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8253947e
route.c 72.9 KB