ipv4: fib_rules: Fix possible infinite loop in fib_empty_table
authorYueHaibing <yuehaibing@huawei.com>
Sat, 29 Dec 2018 06:45:23 +0000 (14:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Dec 2018 20:57:04 +0000 (12:57 -0800)
commit58075ff523af85002bfeace07304d57c59251605
treed28039797f42324090e196afe7073fb5b982cacb
parent178fe94405bffbd1acd83b6ff3b40211185ae9c9
ipv4: fib_rules: Fix possible infinite loop in fib_empty_table

gcc warn this:
net/ipv4/fib_rules.c:203 fib_empty_table() warn:
 always true condition '(id <= 4294967295) => (0-u32max <= u32max)'

'id' is u32, which always not greater than RT_TABLE_MAX
(0xFFFFFFFF), So add a check to break while wrap around.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_rules.c