7 Commits

Author SHA1 Message Date
Anatole Denis
bd8c8089a5 Remove use of deprecated rand.Read
Using the global rand source is deprecated since go 1.20, so instead we
make an explicit local one with a fixed seed

Signed-off-by: Anatole Denis <anatole@unverle.fr>
2024-07-09 11:23:56 +02:00
Andrea Barberio
3e32ddb5ac Fix dependabot warnings, bump Go vesions to 1.19 and 1.20
Updated all the dependencies and addressed dependabot warnings from 12
to 20, starting at
https://github.com/coredhcp/coredhcp/security/dependabot/12 .
This also required dropping Go 1.14/1.15 and bump to the latest two
versions, 1.19 and 1.20.

Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2023-08-08 21:50:49 +02:00
toshic
10c40bd4e9
Fix address usage check (#125)
Signed-off-by: Anton Kortunov <toshik@yandex-team.ru>

Co-authored-by: Anton Kortunov <toshik@yandex-team.ru>
2021-03-10 18:29:21 +01:00
Anatole Denis
8a89011b1f allocators: Export an error for no address available
This is a sentinel error that downstream users should be able to compare
against to identify when the allocator is out of addresses, move it from
the bitmap allocator package to the general allocator interface package

Signed-off-by: Anatole Denis <anatole@unverle.fr>
2021-02-03 14:04:44 +00:00
Anatole Denis
b6dcd5d4ac allocators: Create a bitmap allocator for IPv4
Signed-off-by: Anatole Denis <anatole@unverle.fr>
2021-02-03 14:04:44 +00:00
Anatole Denis
a9aa31766d allocators/bitmap: Lock the bitmap on use
This allocator was not safe for concurrent access. Add a simple lock
around operations on the bitmap itself to protect from that

Signed-off-by: Anatole Denis <anatole@unverle.fr>
2020-08-09 19:05:58 +02:00
Anatole Denis
fb0d278233 plugins/allocators: Rename fixedsize to bitmap
Allocators themselves are implementation details for now; bitmap
reflects better the properties of this allocator

Signed-off-by: Anatole Denis <anatole@unverle.fr>
2020-08-09 19:05:58 +02:00