Re: bgpd: refactor kroute code a fair bit

2022-06-09 Thread Theo Buehler
> I did this change for most calloc calls in kroute.c. So now that is > consistent. Much better. > I think the name2id code should not set an error for the empty string. I > think a lot of the code depends on the mapping of "" to 0. > The ERANGE error should be transformed to a fatalx() so that t

Re: bgpd: refactor kroute code a fair bit

2022-06-09 Thread Claudio Jeker
On Thu, Jun 09, 2022 at 02:54:28PM +0200, Theo Buehler wrote: > On Wed, Jun 08, 2022 at 10:47:48PM +0200, Claudio Jeker wrote: > > and here is the updated diff I forgot to include > > I think I've now done what I reasonably can do to review this. I buy > that this mostly preserves behavior and I'

Re: bgpd: refactor kroute code a fair bit

2022-06-09 Thread Theo Buehler
On Wed, Jun 08, 2022 at 10:47:48PM +0200, Claudio Jeker wrote: > and here is the updated diff I forgot to include I think I've now done what I reasonably can do to review this. I buy that this mostly preserves behavior and I'm convinced that it is a step in the right direction, especially given t

Re: bgpd: refactor kroute code a fair bit

2022-06-09 Thread Claudio Jeker
On Thu, Jun 09, 2022 at 09:47:31AM +0100, Stuart Henderson wrote: > On 2022/06/08 22:47, Claudio Jeker wrote: > > and here is the updated diff I forgot to include > > Not sure if it's expected / not, but I lose interface information > with this: > > > $ diff -wu old new > --- old Thu Jun

Re: bgpd: refactor kroute code a fair bit

2022-06-09 Thread Stuart Henderson
On 2022/06/08 22:47, Claudio Jeker wrote: > and here is the updated diff I forgot to include Not sure if it's expected / not, but I lose interface information with this: $ diff -wu old new --- old Thu Jun 9 09:44:37 2022 +++ new Thu Jun 9 09:44:44 2022 @@ -2,18 +2,19 @@ Flags: * = nexthop va

Re: bgpd: refactor kroute code a fair bit

2022-06-08 Thread Claudio Jeker
On Wed, Jun 08, 2022 at 06:27:36PM +0200, Claudio Jeker wrote: > On Wed, Jun 08, 2022 at 06:10:21PM +0200, Theo Buehler wrote: > > On Wed, Jun 08, 2022 at 01:28:14PM +0200, Claudio Jeker wrote: > > > The idea behind this diff is to use struct kroute_full in more places. > > > Mainly when parsing ro

Re: bgpd: refactor kroute code a fair bit

2022-06-08 Thread Claudio Jeker
On Wed, Jun 08, 2022 at 06:10:21PM +0200, Theo Buehler wrote: > On Wed, Jun 08, 2022 at 01:28:14PM +0200, Claudio Jeker wrote: > > The idea behind this diff is to use struct kroute_full in more places. > > Mainly when parsing route messages. This allows to factor out the pure > > route message pars

Re: bgpd: refactor kroute code a fair bit

2022-06-08 Thread Theo Buehler
On Wed, Jun 08, 2022 at 01:28:14PM +0200, Claudio Jeker wrote: > The idea behind this diff is to use struct kroute_full in more places. > Mainly when parsing route messages. This allows to factor out the pure > route message parsing into dispatch_rtmsg_addr() and use it in both the > gerneral routi

bgpd: refactor kroute code a fair bit

2022-06-08 Thread Claudio Jeker
The idea behind this diff is to use struct kroute_full in more places. Mainly when parsing route messages. This allows to factor out the pure route message parsing into dispatch_rtmsg_addr() and use it in both the gerneral routing socket code but also in fetchtables(). Which removes some duplicated