From caae16b3b8f7ed609c701d732c03076187780644 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 12 Feb 2013 11:41:46 -0800 Subject: [PATCH] ip: handle flush with table > 2^31 Fixes Debian bug #700434 Need to table id in filter to be unsigned to avoid conversion to -1 The documentation for "ip" suggests that, when using multiple routing tables, the table ID can be an arbitrary 32 bit number. I've been writing a script that calculates a table Id based on an IP addresses and sets up tables accordingly based on it. This seems to work for everything I've tried except "ip route flush". If you specify a table to flush with an ID over 2^31, it flushes all IPv4 routing tables. For example: Will delete all routing tables, including the default one. Needless to say, this is quite annoying. I think this is an upstream bug, but your opinions will be greatly appreciated. --- ip/iproute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iproute.c b/ip/iproute.c index 5dc44371..2c2a3319 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -92,7 +92,7 @@ static void usage(void) static struct { - int tb; + unsigned int tb; int cloned; int flushed; char *flushb;