for the default IPv6 address, ensure we don't use the network address

The former seems to confuse the linux kernel.
This commit is contained in:
Nikos Mavrogiannopoulos
2015-11-02 15:59:31 +01:00
parent aed34ebd62
commit 9c78257455
3 changed files with 5 additions and 4 deletions

View File

@@ -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;

View File

@@ -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"

View File

@@ -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"