1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-31 22:45:39 -05:00

introduce address family in v2net

This commit is contained in:
v2ray
2016-08-14 18:14:12 +02:00
parent a9d583b92f
commit 4419f1e3d6
15 changed files with 73 additions and 78 deletions

View File

@@ -238,12 +238,12 @@ func (this *Server) handleUDP(reader io.Reader, writer *v2io.BufferedWriter) err
udpAddr := this.udpAddress
response.Port = udpAddr.Port()
switch {
case udpAddr.Address().IsIPv4():
switch udpAddr.Address().Family() {
case v2net.AddressFamilyIPv4:
response.SetIPv4(udpAddr.Address().IP())
case udpAddr.Address().IsIPv6():
case v2net.AddressFamilyIPv6:
response.SetIPv6(udpAddr.Address().IP())
case udpAddr.Address().IsDomain():
case v2net.AddressFamilyDomain:
response.SetDomain(udpAddr.Address().Domain())
}