Age | Commit message (Collapse) | Author |
|
This changes the return value a bit: 1 will be returned if the value is
changed. But the return value was not documented, and the change should
be for the good anyway. Current callers don't care.
|
|
if we receive a bogus lease with a DNS/NTP server within local scope let's
politely ignore.
Fixes: #4524
|
|
This adds in4_addr_is_localhost() and in4_addr_is_link_local() that only take
an IPv4 "struct in_addr", to match in_addr_is_localhost() and
in_addr_is_link_local() that that a "union in_addr_union".
This matches the existing in4_addr_is_null() call that already exists.
For IPv6 glibc already exports a set of macros, hence we don't add similar
functions in6_addr_is_localhost(). We also drop in6_addr_is_null() as
IN6_IS_ADDR_UNSPECIFIED() already provides that.
|
|
Let's handle NULL hostnames (for unsetting it) before we validate the name.
|
|
Allow setting custom port for the DHCP client to listen on in networkd.
[DHCP]
ListenPort=6677
|
|
|
|
|
|
* networkd: condition_test() can return a negative error, handle that
If a condition check fails with an error we should not consider the check
successful. Fix that.
We should probably also improve logging in this case, but for now, let's just
unbreak this breakage.
Fixes: #3236
* condition: handle unrecognized architectures nicer
When we encounter a check for an architecture we don't know we should not
let the condition check fail with an error code, but instead simply return
false. After all the architecture might just be newer than the ones we know, in
which case it's certainly not our local one.
Fixes: #3236
|
|
various changes, most importantly regarding memory metrics
|
|
Super-important change, yeah!
|
|
Apparently newer gcc versions are a bit more forgiving when assigning an
"unsigned char*" pointer to something of a different type. Let's add the
missing cast so that old gcc versions are fine, too.
|
|
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:
- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
new configuration options have been added to networkd to make this
configurable.
- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
message, and has direct, friendly acessor functions for the singleton RA
properties, as well as an iterative interface to iterate through known and
unsupported options. The router object may either be retrieved from the wire,
or generated from raw data. In many ways the sd-ndisc API now matches the
sd-lldp API, except that no implicit database of seen data is kept. (Note
that sd-ndisc actually had a half-written, but unused implementaiton of such
a store, which is removed now.)
- sd-ndisc will now collect the reception timestamps of RA, which is useful to
make sd_ndisc_router fully descriptive of what it covers.
Fixes: #1079
|
|
serializing
Let's use the usual libc API for serializing IPv6 addresses, instead of the
NDISC-specific macro we should get rid of anyway.
|
|
|
|
sd-ndisc has something like this, let's add this for sd-lldp, too.
|
|
It might very well return EAGAIN in case of packet checksum problems and
suchlike, hence let's better handle this nicely, the same way as we do it in
the other sd-network libraries for incoming datagrams.
|
|
|
|
Let's make sure the inline functions for retrieving TLV data actually carry TLV
in the name, so that we don#t assume they retrieve the whole, raw packet data.
|
|
This way it's nicer to use as it matches how sd_lldp_neighbor_tlv_next()
indicates an EOF too via its return value.
|
|
|
|
|
|
Let's simply encode this in the parameter name.
|
|
setting the ifindex
Let's make sd-lldp a bit more like sd-ndisc ant the other APIs, and add proper
ref counting and a separate call for setting the ifindex.
This also adds a new lldp_reset() call we can use at various places to close
all fds. This is also similar to how sd-ndisc already does it.
|
|
It's a good idea to store away the recption time of LLDP packets in the
neighbor object, simply because the LLDP data only has a validity of a certain
amount of time.
Hence, let's record the timestamp when we receive the datagram and expose an
API for it. Also, automatically expire LLDP neighbors based on this new
timestamp.
|
|
Assorted stuff
|
|
Fixes: 9ed8b06c9be4a5efae432d5cf4b1c47d03e6f107
|
|
Let's better ignore an invalid message size parameter, than assume ridiculously
larger sizes.
|
|
Fix multiple unaligned accesses in test-dns-packet and sd-dhcp-server.
|
|
|
|
As suggested:
https://github.com/systemd/systemd/pull/3328#discussion-diff-64285764
|
|
Let's use usec_t internally always, when dealing with time values.
Let's use uint8_t* pointers if we are dealing with generic byte pointers.
|
|
Whitespace doesn't hurt and helps structuring things.
|
|
|
|
Let's better check the size before we subtract. Also, let's change the size
argument to size_t, as it cannot be signed anyway.
Finally, use EBADMSG for indicating invalid packets, like we do everywhere
else.
|
|
|
|
Otherwise it gets too confusing whether "timeout" refers to an event source or
just a timeout time specification.
|
|
Also make use of it where appropriate.
|
|
There's no "client" object, in both cases. There's only "nd".
This wasn't noticed before, as the context object is currently not actually
used by the log macros.
|
|
|
|
Appears to be a (confusing) left-over from copy/paste when this still was
ipv4ll code.
|
|
|
|
Appears to be a copy/paste mistake from sd-ipv4ll. Let's get rid of this.
|
|
Let's make the seed actually work as stable seed, and use siphash24 to generate
the series of addresses, instead of the opaque libc random_r().
This not only makes the seed truly work as stable, portable seed, but also
makes the code quite a bit shorter, and removes a couple of memory allocations.
|
|
Let's make clear this always has the same size, since otherwise it's not useful
for reproducible runs, which this is really about however.
|
|
for errors
|
|
We try to stick to usec_t for encoding time information, do that here too. In
particular, get rid of "int" second specifications, since signed timespans are
a weird thing.
|
|
|
|
|
|
This state is active immediately after the state engine was started, but before
the first timer hits.
This way multiple _start() invocations on the same object are always detected
correctly.
|
|
This is much less confusing, since there's also sd_ipv4acd_stop(), which was
idfferent from ipv4acd_stop().
After renaming it, let's also use the funciton when destroying ipv4acd objects,
as the code is pretty much the same for that.
|