From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: increase the number of routing tables Date: Mon, 30 Jan 2012 11:21:23 -0800 Message-ID: <20120130112123.7602059e@nehalam.linuxnetplumber.net> References: <4F25D52B.1050701@wildgooses.com> <20120129163151.416035ef@nehalam.linuxnetplumber.net> <20120130081458.697d6099@nehalam.linuxnetplumber.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: netfilter-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jan Engelhardt Cc: Ed W , Simon Chen , netfilter@vger.kernel.org On Mon, 30 Jan 2012 19:57:20 +0100 (CET) Jan Engelhardt wrote: > On Monday 2012-01-30 17:14, Stephen Hemminger wrote: > > >> >> > There are 2147483647. > >> >> > >> >> Any reason why it's not an unsigned 32bit int? (surely there is a corner > >> >> case where this is useful...) > >> > > >> >The 8 bit value is enshrined in the API for 'struct rtmsg' and therefore > >> >increasing it would break existing applications. > >> > >> Actually, what Ed (and me too) was wondering about was: > >> > >> why does `ip route show table $[0x80000000]` not print an empty table, > >> i.e. where is it that some code uses int/s32 during parsing of > >> the argument and/or the RTA_TABLE attribute? > > > >There are lots of places internally in ip utilities that use u32 > >for route table. But the route input/output message format is still limited > >to 8 bits. > > But then, adding a rule to table 258 would make it show up in table 2 as > well, which is not the case. Ok, drilling deeper, overlooked the extended table support. Tables >= 256 are handled by setting rtm_table to RT_TABLE_UNSPEC and sending a RTA_TABLE attribute. Therefore it has worked for quite a while. But, I also see code in other utilities (like net-snmp and quagga) which don't know about how to handle tables other than main. But that is a different issue.