From 9c782574558f32046f528f93d168985a785167cb Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 2 Nov 2015 15:59:31 +0100 Subject: [PATCH] for the default IPv6 address, ensure we don't use the network address The former seems to confuse the linux kernel. --- src/ip-lease.c | 5 +++-- tests/full-test | 2 +- tests/radius-test | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ip-lease.c b/src/ip-lease.c index 4bc34cd0..caf6a786 100644 --- a/src/ip-lease.c +++ b/src/ip-lease.c @@ -454,7 +454,6 @@ int get_ipv6_lease(main_server_st* s, struct proc_st* proc) proc->ipv6->rip_len = sizeof(struct sockaddr_in6); memcpy(&proc->ipv6->rip, &rnd, proc->ipv6->rip_len); - /* LIP = network */ mslog(s, proc, LOG_DEBUG, "selected IP: %s", human_addr((void*)&proc->ipv6->rip, proc->ipv6->rip_len, buf, sizeof(buf))); @@ -463,8 +462,10 @@ int get_ipv6_lease(main_server_st* s, struct proc_st* proc) } while(1); finish: - /* LIP = network address */ + /* LIP = network address + 1 */ memcpy(&proc->ipv6->lip, &network, sizeof(struct sockaddr_in6)); + SA_IN6_U8_P(&proc->ipv6->lip)[15] |= 1; + proc->ipv6->lip_len = sizeof(struct sockaddr_in6); proc->ipv6->prefix = subnet_prefix; diff --git a/tests/full-test b/tests/full-test index abe395a1..933c069b 100755 --- a/tests/full-test +++ b/tests/full-test @@ -103,7 +103,7 @@ if test $? != 0;then stop fi -ping6 -w 5 fd91:6d87:7341:db6a:: +ping6 -w 5 fd91:6d87:7341:db6a::1 if test $? != 0;then kill $PID echo "Cannot ping the IPv6 of ocserv" diff --git a/tests/radius-test b/tests/radius-test index 23a4820e..832fd5c1 100755 --- a/tests/radius-test +++ b/tests/radius-test @@ -95,7 +95,7 @@ if test $? != 0;then stop fi -ping6 -w 5 fc13:71:ea31:4b4e:: +ping6 -w 5 fc13:71:ea31:4b4e::1 if test $? != 0;then kill $PID echo "Cannot ping the IPv6 of ocserv"