mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-09-19 09:51:28 +03:00
Change IP structure so that IPv4 addresses are stored in RFC3493 format
In addition to saving 4 bytes for each instantiation, this change makes IP-related operations faster and clearer. https://tools.ietf.org/html/rfc3493.html#section-3.7
This commit is contained in:
@@ -155,12 +155,12 @@ void IPsecWin7UpdateHostIPAddressList(IPSEC_WIN7 *w)
|
||||
if (IsIP4(ip))
|
||||
{
|
||||
a.IpVersion = 4;
|
||||
Copy(a.IpAddress.IPv4Address, ip->addr, 4);
|
||||
Copy(a.IpAddress.IPv4Address, IPV4(ip->address), sizeof(a.IpAddress.IPv4Address));
|
||||
}
|
||||
else
|
||||
{
|
||||
a.IpVersion = 6;
|
||||
Copy(a.IpAddress.IPv6Address, ip->ipv6_addr, 16);
|
||||
Copy(a.IpAddress.IPv6Address, ip->address, sizeof(a.IpAddress.IPv6Address));
|
||||
}
|
||||
|
||||
WriteBuf(buf, &a, sizeof(WFP_LOCAL_IP));
|
||||
|
||||
Reference in New Issue
Block a user