summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
AgeCommit message (Collapse)Author
2016-06-06lldp: minor coding style improvementLennart Poettering
2016-06-06lldp: add sd_lldp_get_event() callLennart Poettering
sd-ndisc has something like this, let's add this for sd-lldp, too.
2016-06-06lldp: deal properly with recv() returning EAGAIN/EINTRLennart Poettering
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.
2016-06-06lldp: pass correct neighbor object to REMOVED callbackLennart Poettering
2016-06-06lldp: rename TLV accessor pseudo-macrosLennart Poettering
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.
2016-06-06lldp: make sd_lldp_neighbor_tlv_rewind() return whether there's a first entryLennart Poettering
This way it's nicer to use as it matches how sd_lldp_neighbor_tlv_next() indicates an EOF too via its return value.
2016-06-06lldp: use NULL instead 0, when we deal with a pointerLennart Poettering
2016-06-06lldp: add _public_ to a two exported functions missing itLennart Poettering
2016-06-06lldp: clarify that sd_lldp_neighbor_get_ttl() returns secondsLennart Poettering
Let's simply encode this in the parameter name.
2016-06-06lldp: add proper ref counting to sd_lldp object and a separate call for ↵Lennart Poettering
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.
2016-06-06sd-lldp: take triple timestamp when reading LLDP packetsLennart Poettering
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.
2016-06-04Merge pull request #3392 from poettering/assorted-stuffZbigniew Jędrzejewski-Szmek
Assorted stuff
2016-05-31network: fix wrong include of source file "ether-addr-util.c" (#3402)Thomas Haller
Fixes: 9ed8b06c9be4a5efae432d5cf4b1c47d03e6f107
2016-05-30dhcp-server: fix integer underflowLennart Poettering
Let's better ignore an invalid message size parameter, than assume ridiculously larger sizes.
2016-05-28Merge pull request #3360 from glaubitz/masterZbigniew Jędrzejewski-Szmek
Fix multiple unaligned accesses in test-dns-packet and sd-dhcp-server.
2016-05-27networkd/sd-dhcp-server: Fix unaligned access in parse_request().John Paul Adrian Glaubitz
2016-05-26ipv4ll: shorten some checks by using IN_SET a bitLennart Poettering
As suggested: https://github.com/systemd/systemd/pull/3328#discussion-diff-64285764
2016-05-26sd-ndisc: small coding style fixesLennart Poettering
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.
2016-05-26sd-ndisc: add more whitespaceLennart Poettering
Whitespace doesn't hurt and helps structuring things.
2016-05-26sd-ndisc: stop discovery properly when something failsLennart Poettering
2016-05-26sd-ndisc: rework size checking in ndisc_ra_parse()Lennart Poettering
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.
2016-05-26sd-ndisc: simplify clamping of router "pref" parameterLennart Poettering
2016-05-26sd-ndisc: append "event_source" to event source objects stored in structuresLennart Poettering
Otherwise it gets too confusing whether "timeout" refers to an event source or just a timeout time specification.
2016-05-26sd-ndisc: add log_ndisc_errno() macro, to complement log_ndisc() like elsewhereLennart Poettering
Also make use of it where appropriate.
2016-05-26sd-ndisc: use the right object to pass to log_ndisc()Lennart Poettering
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.
2016-05-26sd-ndisc: Typo fix: s/advertisment/advertisement/Lennart Poettering
2016-05-26ipv4acd: rename "ll" parameter to "acd" everywhereLennart Poettering
Appears to be a (confusing) left-over from copy/paste when this still was ipv4ll code.
2016-05-26sd-ipv4ll: add a bit of logging to IPv4LL tooLennart Poettering
2016-05-26sd-ipv4acd: drop IPV4ACD_NETWORK definitionLennart Poettering
Appears to be a copy/paste mistake from sd-ipv4ll. Let's get rid of this.
2016-05-26ipv4acd: rework how we pick ipv4ll addressesLennart Poettering
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.
2016-05-26ipv4ll: change "seed" parameter to be uint64_tLennart Poettering
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.
2016-05-26ipv4acd: make sure our event handler callbacks never check uninitialized "r" ↵Lennart Poettering
for errors
2016-05-26ipv4acd: normalize time types to usec_tLennart Poettering
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.
2016-05-26ipv4acd: in case the state engine is reused, reset n_conflict timer to 0Lennart Poettering
2016-05-26ipv4acd: no need to memcpy() where assignment sufficesLennart Poettering
2016-05-26ipv4acd: introduce new "started" stateLennart Poettering
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.
2016-05-26ipv4acd: rename ipv4acd_stop() → ipv4acd_reset()Lennart Poettering
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.
2016-05-26ipv4acd: add "_event_source" suffix to event source objectsLennart Poettering
Otherwise the field "receive_message" is a bit too confusing, as it suggests it actually stores a message object of some kind.
2016-05-26ipv4acd: make the iteration and conflict fields unsignedLennart Poettering
They are counters after all, and can never go below zero, hence don't pretend with the chose type that they could. Also, prefix their name with "n_", to indicate that they are counters.
2016-05-26ipv4l-{acd,ll}: make sure ipv4 addresses are unsignedLennart Poettering
And some other minor fixes.
2016-05-26ipv4acd: library code should never logLennart Poettering
Or actually, not at any level higher than debug.
2016-05-26sd-ipv4{acl,ll}: don't make use of RefCnt objectsLennart Poettering
These objects are only useful when multiple threads are involved, as they operate with atomic operations. Given that our libraries are explicitly not thread-safe don't make use of RefCnt here, and make things a bit simpler.
2016-05-26sd-network: don't needlessly abbreviate "callback" as "cb" in struct membersLennart Poettering
It's OK to abbreviate this in the local scope, but otherwise, let's not be needlessly terse.
2016-05-26dhcp: fix operator precedence issue with macroLennart Poettering
2016-05-26sd-ndisc: make the _stop() call idempotentLennart Poettering
It's a good idea to make stopcalls idempotent, so that they become nops if the object is already stopped.
2016-05-26sd-network: fix up assertion chaosLennart Poettering
assert_return() should only be used to validate user-facing parameters and state, assert() should be used for checking our own internal state and parameters.
2016-05-26sd-ndisc: rename sd_ndisc_init() to sd_ndisc_reset()Lennart Poettering
After all, it's actually used for resetting the state, not only for the initial initialization. While we are at it, also simplify the error path for sd_ndisc_discovery_start().
2016-05-26sd-network: rename "index" field of the various clients to "ifindex"Lennart Poettering
A field "index" is not particularly precise and also might conflict with libc's index() function definition. Also, pretty much everywhere else we call this concept "ifindex", including in networkd, the primary user of these libraries. Hence, let's fix this up and call this "ifindex" everywhere here too.
2016-05-26sd-ndisc: properly make various parameters unsignedLennart Poettering
2016-05-26sd-dhcp: shorten NUL initialization a bitLennart Poettering