Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Theo Buehler
On Mon, Jan 04, 2021 at 08:48:55PM +0100, Otto Moerbeek wrote: > On Mon, Jan 04, 2021 at 05:50:53PM +0100, Otto Moerbeek wrote: > > > tOn Mon, Jan 04, 2021 at 01:42:48PM +0100, Theo Buehler wrote: > > > > > > > + return log_sockaddr(addr2sa(addr, 0, ), len); > > > > > > > > Perhaps

Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Otto Moerbeek
On Mon, Jan 04, 2021 at 05:50:53PM +0100, Otto Moerbeek wrote: > tOn Mon, Jan 04, 2021 at 01:42:48PM +0100, Theo Buehler wrote: > > > > > + return log_sockaddr(addr2sa(addr, 0, ), len); > > > > > > Perhaps I haven't yet had enough coffee this year, but I'm unsure > > > whether it

Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Kris Katterjohn
On Mon, Jan 04, 2021 at 01:42:48PM +0100, Theo Buehler wrote: > > > + return log_sockaddr(addr2sa(addr, 0, ), len); > > > > Perhaps I haven't yet had enough coffee this year, but I'm unsure > > whether it is actually guaranteed that addr2sa() is called before the > > second len in this

Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Otto Moerbeek
tOn Mon, Jan 04, 2021 at 01:42:48PM +0100, Theo Buehler wrote: > > > + return log_sockaddr(addr2sa(addr, 0, ), len); > > > > Perhaps I haven't yet had enough coffee this year, but I'm unsure > > whether it is actually guaranteed that addr2sa() is called before the > > second len in this

Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Florian Obser
OK On Mon, Jan 04, 2021 at 10:46:39AM +0100, Claudio Jeker wrote: > In bgpd most prefixes and addresses are stored as struct bgpd_addr. When > it is printed it uses inet_ntop() which is not ideal since it does not > handle IPv6 scoped_id. Instead convert to a struct sockaddr and use >

Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Theo Buehler
> > + return log_sockaddr(addr2sa(addr, 0, ), len); > > Perhaps I haven't yet had enough coffee this year, but I'm unsure > whether it is actually guaranteed that addr2sa() is called before the > second len in this line is passed to log_sockaddr(). Answering my own question: C99 and

Re: use getnameinfo in bgpd to print addresses

2021-01-04 Thread Theo Buehler
On Mon, Jan 04, 2021 at 10:46:39AM +0100, Claudio Jeker wrote: > In bgpd most prefixes and addresses are stored as struct bgpd_addr. When > it is printed it uses inet_ntop() which is not ideal since it does not > handle IPv6 scoped_id. Instead convert to a struct sockaddr and use > log_sockaddr()

use getnameinfo in bgpd to print addresses

2021-01-04 Thread Claudio Jeker
In bgpd most prefixes and addresses are stored as struct bgpd_addr. When it is printed it uses inet_ntop() which is not ideal since it does not handle IPv6 scoped_id. Instead convert to a struct sockaddr and use log_sockaddr() which in turn uses getnameinfo. Ideally the same should be done for