summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/dhcpv6message.go
diff options
context:
space:
mode:
authorMikoĊ‚aj Walczak <mikiwalczak+github@gmail.com>2018-11-26 22:01:44 +0100
committerinsomniac <insomniacslk@users.noreply.github.com>2018-11-27 16:24:39 +0000
commit0b70b1f1fb1bf27e16203b02c4fc74bea90d5b1e (patch)
tree0b1a1b6e52af048ca0a0a20b2a6603c812e90abf /dhcpv6/dhcpv6message.go
parente82b966866c8e05d9d6495deedfe2c0928950cd5 (diff)
Test TransactionID generation
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r--dhcpv6/dhcpv6message.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go
index eeb1591..82d44b4 100644
--- a/dhcpv6/dhcpv6message.go
+++ b/dhcpv6/dhcpv6message.go
@@ -34,11 +34,13 @@ func BytesToTransactionID(data []byte) (*uint32, error) {
return &tid, nil
}
+var randomRead = rand.Read
+
func GenerateTransactionID() (*uint32, error) {
var tid *uint32
for {
tidBytes := make([]byte, 4)
- n, err := rand.Read(tidBytes)
+ n, err := randomRead(tidBytes)
if err != nil {
return nil, err
}