diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2005-04-28 21:14:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-04-28 21:14:37 +0200 |
commit | 7b3c63ac7cb5e2e6680727045aa35c2e5f1bace7 (patch) | |
tree | 2c7fe5e4b7676df9483294bd164664ed202a948b /include/net | |
parent | [IPV6]: Incorrect permissions on route flush sysctl (diff) | |
download | linux-7b3c63ac7cb5e2e6680727045aa35c2e5f1bace7.tar.xz linux-7b3c63ac7cb5e2e6680727045aa35c2e5f1bace7.zip |
[PKT_SCHED]: Fix range in psched_tod_diff() to 0..bound
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/pkt_sched.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 87496e3aa330..7352e455053c 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -140,7 +140,7 @@ psched_tod_diff(int delta_sec, int bound) if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1) return bound; delta = delta_sec * 1000000; - if (delta > bound) + if (delta > bound || delta < 0) delta = bound; return delta; } @@ -156,7 +156,8 @@ psched_tod_diff(int delta_sec, int bound) __delta += 1000000; \ case 1: \ __delta += 1000000; \ - case 0: ; \ + case 0: \ + __delta = abs(__delta); \ } \ __delta; \ }) |