Age | Commit message (Collapse) | Author |
|
All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.
This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result.
|
|
Merge sd_dhcp_server_set_address() and sd_dhcp_server_set_lease_pool() into
sd_dhcp_server_configure_pool() as the behavior of the two former depends
on the order they are called in. The flexibility is not needed, so let's
just do this in one call.
|
|
Rather than having all clients attempt to get the same leases (starting at the
beginning of the pool), make each client star at a random offset into the pool
determined by their client id. This greatly increases the chances of a given
client receiving the same IP address even though both the client and server
have lost any lease information (and distinct server instances handing out
the same leases).
|
|
For now, this is very simple and IP addresses have to be configured
manually.
|
|
|
|
This avoids confusion what this is, in particular as libc knows an
index() function.
|
|
|
|
No need to invole atomic ops in single-threaded APIs, let's simplify
this.
|
|
This one is simply to add: encode the tzdata timezone in the DHCP
options and optionally make use of it.
|
|
|
|
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style.
|
|
log_error_errno() as log calls that take error numbers
This change has two benefits:
- The format string %m will now resolve to the specified error (or to
errno if the specified error is 0. This allows getting rid of a ton of
strerror() invocations, a function that is not thread-safe.
- The specified error can be passed to the journal in the ERRNO= field.
Now of course, we just need somebody to convert all cases of this:
log_error("Something happened: %s", strerror(-r));
into thus:
log_error_errno(-r, "Something happened: %m");
|
|
For now we simply take these values from the server's address.
|
|
|
|
Make sure we don't hand out the same IP twice. We still don't
handle lease expiry.
|
|
|
|
|
|
|
|
|
|
We would like to use the UDP socket, but we cannot as we need to specify
the MAC address manually.
|
|
Parse the maximum message size the client can accept and the client id, falling back to
sane defaults if they are not set.
|
|
|
|
We will (at least at first), restrict our focus to running the server
on at most one interface.
|
|
Bind to UDP socket and listen for messages, discarding anything we receive.
|
|
|