1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-02-08 17:25:24 -05:00

proto for destination

This commit is contained in:
Darien Raymond
2016-09-20 11:53:05 +02:00
parent c518726910
commit 7de7588ec2
35 changed files with 170 additions and 195 deletions

View File

@@ -22,7 +22,7 @@ func SetOriginalDestOptions(fd int) error {
func RetrieveOriginalDest(oob []byte) v2net.Destination {
msgs, err := syscall.ParseSocketControlMessage(oob)
if err != nil {
return nil
return v2net.Destination{}
}
for _, msg := range msgs {
if msg.Header.Level == syscall.SOL_IP && msg.Header.Type == syscall.IP_ORIGDSTADDR {
@@ -31,7 +31,7 @@ func RetrieveOriginalDest(oob []byte) v2net.Destination {
return v2net.UDPDestination(ip, port)
}
}
return nil
return v2net.Destination{}
}
func ReadUDPMsg(conn *net.UDPConn, payload []byte, oob []byte) (int, int, int, *net.UDPAddr, error) {