Re: route: improve inet6_makenetandmask

2018-06-24 Thread Florian Obser
On Sun, Jun 24, 2018 at 10:29:55PM +0200, Klemens Nanni wrote: > On Sun, Jun 24, 2018 at 10:09:26PM +0200, Florian Obser wrote: > > I don't understand why it's equivalent. > > > > prefixlen() seems to operate on so_mask while the only caller of > > inet6_makenetandmask() passes in so_dst. > > > >

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Klemens Nanni
On Sun, Jun 24, 2018 at 10:09:26PM +0200, Florian Obser wrote: > I don't understand why it's equivalent. > > prefixlen() seems to operate on so_mask while the only caller of > inet6_makenetandmask() passes in so_dst. > > Assuming it is equivalent, inet6_makenetandmask() is now missnamed and > I t

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Florian Obser
On Sun, Jun 24, 2018 at 07:54:48PM +0200, Jeremie Courreges-Anglas wrote: > On Sun, Jun 24 2018, Klemens Nanni wrote: > > On Sun, Jun 24, 2018 at 04:34:01PM +0200, Jeremie Courreges-Anglas wrote: > >> So if I understand correctly, this diff does three things: > >> 1. shorten the code (remove the e

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Klemens Nanni
On Sun, Jun 24, 2018 at 08:06:48PM +0200, Sebastian Benoit wrote: > And i think that > > route add -inet6 -prefixlen 56 2001:db10:: 2001:db9::5 As stated in the manual The implicit network mask generated in the AF_INET case can be overridden by making sure this option follows the

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Sebastian Benoit
Jeremie Courreges-Anglas(j...@wxcvbn.org) on 2018.06.24 19:54:48 +0200: > On Sun, Jun 24 2018, Klemens Nanni wrote: > > On Sun, Jun 24, 2018 at 04:34:01PM +0200, Jeremie Courreges-Anglas wrote: > >> So if I understand correctly, this diff does three things: > >> 1. shorten the code (remove the exp

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Jeremie Courreges-Anglas
On Sun, Jun 24 2018, Klemens Nanni wrote: > On Sun, Jun 24, 2018 at 04:34:01PM +0200, Jeremie Courreges-Anglas wrote: >> So if I understand correctly, this diff does three things: >> 1. shorten the code (remove the explicit mask handling from this >>function) >> 2. stop considering 2000::/3 as

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Klemens Nanni
On Sun, Jun 24, 2018 at 04:34:01PM +0200, Jeremie Courreges-Anglas wrote: > So if I understand correctly, this diff does three things: > 1. shorten the code (remove the explicit mask handling from this >function) > 2. stop considering 2000::/3 as special per RFC3587 > 3. stop considering 2001:d

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Denis Fondras
On Sun, Jun 24, 2018 at 04:34:01PM +0200, Jeremie Courreges-Anglas wrote: > 3. ... why should we stop assuming that the user really means to >configure a route for a /64 if the host id part is all-zeroes? Is >this really part of what has been deprecated by RFC3587? > > I can understand th

Re: route: improve inet6_makenetandmask

2018-06-24 Thread Jeremie Courreges-Anglas
On Mon, Jun 11 2018, Klemens Nanni wrote: > Here's a new diff that removes the duplicate parsing bits as mentioned > before but leaves masking the address to mask_addr() instead of doing it > manually. > > Furthermore, it also stops route(8) from assuming address strings > without explicit prefix

Re: route: improve inet6_makenetandmask

2018-06-20 Thread Klemens Nanni
On Mon, Jun 11, 2018 at 01:09:17AM +0200, Klemens Nanni wrote: > Feedback? Objections? OK? OK denis so far, anyone else?

Re: route: improve inet6_makenetandmask

2018-06-10 Thread Klemens Nanni
Here's a new diff that removes the duplicate parsing bits as mentioned before but leaves masking the address to mask_addr() instead of doing it manually. Furthermore, it also stops route(8) from assuming address strings without explicit prefix length to be /64. The old behaviour described in RFC

Re: route: improve inet6_makenetandmask

2018-06-03 Thread Klemens Nanni
On Sun, May 27, 2018 at 03:13:04AM +0200, Klemens Nanni wrote: > On Sat, May 26, 2018 at 11:49:29PM +0200, Denis Fondras wrote: > > Not related to this diff but RFC2374 has been made obsolete by RFC3587 for > > some > > years : "implementations should not make any assumptions about 2000::/3 > > b

Re: route: improve inet6_makenetandmask

2018-05-26 Thread Klemens Nanni
On Sat, May 26, 2018 at 11:49:29PM +0200, Denis Fondras wrote: > Not related to this diff but RFC2374 has been made obsolete by RFC3587 for > some > years : "implementations should not make any assumptions about 2000::/3 being > special". I think we can simplify this "else if" :) Agreed, although

Re: route: improve inet6_makenetandmask

2018-05-26 Thread Denis Fondras
On Sat, May 26, 2018 at 12:54:03PM +0200, Klemens Nanni wrote: > inet6_makenetandmask() parses the provided prefix length `plen' twice: > first from inside prefixlen() which sets the mask, then right again > doing almost the same dance to find out which bits to zero in the > provided address. > >

route: improve inet6_makenetandmask

2018-05-26 Thread Klemens Nanni
inet6_makenetandmask() parses the provided prefix length `plen' twice: first from inside prefixlen() which sets the mask, then right again doing almost the same dance to find out which bits to zero in the provided address. But once prefixlen() set so_mask, we can just use it to actually mask the a