diff options
author | MikoĊaj Walczak <mikiwalczak+github@gmail.com> | 2018-11-26 22:01:44 +0100 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2018-11-27 16:24:39 +0000 |
commit | 0b70b1f1fb1bf27e16203b02c4fc74bea90d5b1e (patch) | |
tree | 0b1a1b6e52af048ca0a0a20b2a6603c812e90abf /dhcpv6/dhcpv6message.go | |
parent | e82b966866c8e05d9d6495deedfe2c0928950cd5 (diff) |
Test TransactionID generation
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r-- | dhcpv6/dhcpv6message.go | 4 |
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 } |