Re: [PATCH 1/3] lib: Add ip6_common_octets function

2017-06-06 Thread Toke Høiland-Jørgensen
Ondrej Zajicek writes: > On Tue, Jun 06, 2017 at 01:00:38PM +0200, Toke Høiland-Jørgensen wrote: >> Christian Tacke writes: >> >> > Hi, >> > >> > just out of curiosity: >> > >> > On Mon, Jun 05, 2017 at 23:49:52 +0200, Toke Høiland-Jørgensen wrote: >> > [...] >> >> +int >> >> +ip6_common_octets

Re: [PATCH 1/3] lib: Add ip6_common_octets function

2017-06-06 Thread Ondrej Zajicek
On Tue, Jun 06, 2017 at 01:00:38PM +0200, Toke Høiland-Jørgensen wrote: > Christian Tacke writes: > > > Hi, > > > > just out of curiosity: > > > > On Mon, Jun 05, 2017 at 23:49:52 +0200, Toke Høiland-Jørgensen wrote: > > [...] > >> +int > >> +ip6_common_octets(ip6_addr a, ip6_addr b) > >> +{ > >>

Re: [PATCH 1/3] lib: Add ip6_common_octets function

2017-06-06 Thread Toke Høiland-Jørgensen
Christian Tacke writes: > Hi, > > just out of curiosity: > > On Mon, Jun 05, 2017 at 23:49:52 +0200, Toke Høiland-Jørgensen wrote: > [...] >> +int >> +ip6_common_octets(ip6_addr a, ip6_addr b) >> +{ >> + int i, j, common = 0; > [...] > > Why aren't you using an unsigned int here? No particular

Re: [PATCH 1/3] lib: Add ip6_common_octets function

2017-06-06 Thread Christian Tacke
Hi, just out of curiosity: On Mon, Jun 05, 2017 at 23:49:52 +0200, Toke Høiland-Jørgensen wrote: [...] > +int > +ip6_common_octets(ip6_addr a, ip6_addr b) > +{ > + int i, j, common = 0; [...] Why aren't you using an unsigned int here? Cheers Christian -- www.cosmokey.com

[PATCH 1/3] lib: Add ip6_common_octets function

2017-06-05 Thread Toke Høiland-Jørgensen
This function computes the number of common octets between two IPv6 addresses, for use in Babel prefix compression. Signed-off-by: Toke Høiland-Jørgensen --- lib/ip.c | 14 ++ lib/ip.h | 1 + 2 files changed, 15 insertions(+) diff --git a/lib/ip.c b/lib/ip.c index 9497248c..af81704