Commit ae638ec8 authored by Grégoire Henry's avatar Grégoire Henry Committed by Juliusz Chroboczek

Fix compilation error on BSD (kernel_routes).

parent fca59416
...@@ -153,17 +153,16 @@ static int ifindex_lo = -1; ...@@ -153,17 +153,16 @@ static int ifindex_lo = -1;
static int seq; static int seq;
static int static int
mask2len(const struct in6_addr *addr) mask2len(const unsigned char *p, const int size)
{ {
int i = 0, j; int i = 0, j;
const u_char *p = (const u_char *)addr;
for(j = 0; j < 16; j++, p++) { for(j = 0; j < size; j++, p++) {
if(*p != 0xff) if(*p != 0xff)
break; break;
i += 8; i += 8;
} }
if(j < 16) { if(j < size) {
switch(*p) { switch(*p) {
#define MASKLEN(m, l) case m: do { i += l; break; } while (0) #define MASKLEN(m, l) case m: do { i += l; break; } while (0)
MASKLEN(0xfe, 7); break; MASKLEN(0xfe, 7); break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment