1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-11 15:09:07 -04:00

leverage dice.Roll

This commit is contained in:
v2ray
2016-06-29 23:53:50 +02:00
parent 71c9bd678c
commit 98cc28a4c4
3 changed files with 6 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
package kcp
import (
"math/rand"
"net"
"github.com/v2ray/v2ray-core/common/dice"
"github.com/v2ray/v2ray-core/common/log"
v2net "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/transport/internet"
@@ -18,7 +18,7 @@ func DialKCP(src v2net.Address, dest v2net.Destination) (internet.Connection, er
}
cpip := NewSimpleAuthenticator()
session := NewConnection(uint16(rand.Uint32()), conn, conn.LocalAddr().(*net.UDPAddr), conn.RemoteAddr().(*net.UDPAddr), cpip)
session := NewConnection(uint16(dice.Roll(65536)), conn, conn.LocalAddr().(*net.UDPAddr), conn.RemoteAddr().(*net.UDPAddr), cpip)
session.FetchInputFrom(conn)
return session, nil