mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user