summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use mfree moreZbigniew Jędrzejewski-Szmek2016-10-1610-29/+10
|
* Various fixes for typos found by lintian (#3705)Michael Biebl2016-07-121-1/+1
|
* Fix #3236 (#3633)Lennart Poettering2016-06-301-4/+4
| | | | | | | | | | | | | | | | | | | | | * 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
* Merge pull request #3481 from poettering/relative-memcgLennart Poettering2016-06-161-1/+1
|\ | | | | various changes, most importantly regarding memory metrics
| * sd-ndisc: add missing castLennart Poettering2016-06-141-1/+1
| | | | | | | | | | | | 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.
* | tree-wide: htonl() is weird, let's use htobe32() instead (#3538)Lennart Poettering2016-06-154-9/+10
|/ | | Super-important change, yeah!
* network: beef up ipv6 RA support considerablyLennart Poettering2016-06-066-426/+1185
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* network: use inet_ntop() rather than SD_NDISC_ADDRESS_FORMAT_VAL() when ↵Lennart Poettering2016-06-061-6/+9
| | | | | | | serializing Let's use the usual libc API for serializing IPv6 addresses, instead of the NDISC-specific macro we should get rid of anyway.
* lldp: minor coding style improvementLennart Poettering2016-06-061-4/+3
|
* lldp: add sd_lldp_get_event() callLennart Poettering2016-06-061-0/+6
| | | | sd-ndisc has something like this, let's add this for sd-lldp, too.
* lldp: deal properly with recv() returning EAGAIN/EINTRLennart Poettering2016-06-061-1/+5
| | | | | | 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.
* lldp: pass correct neighbor object to REMOVED callbackLennart Poettering2016-06-061-2/+1
|
* lldp: rename TLV accessor pseudo-macrosLennart Poettering2016-06-062-9/+8
| | | | | 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.
* lldp: make sd_lldp_neighbor_tlv_rewind() return whether there's a first entryLennart Poettering2016-06-061-1/+1
| | | | | This way it's nicer to use as it matches how sd_lldp_neighbor_tlv_next() indicates an EOF too via its return value.
* lldp: use NULL instead 0, when we deal with a pointerLennart Poettering2016-06-061-1/+1
|
* lldp: add _public_ to a two exported functions missing itLennart Poettering2016-06-061-2/+2
|
* lldp: clarify that sd_lldp_neighbor_get_ttl() returns secondsLennart Poettering2016-06-061-3/+3
| | | | Let's simply encode this in the parameter name.
* lldp: add proper ref counting to sd_lldp object and a separate call for ↵Lennart Poettering2016-06-063-26/+59
| | | | | | | | | | 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.
* sd-lldp: take triple timestamp when reading LLDP packetsLennart Poettering2016-06-063-3/+33
| | | | | | | | | | 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.
* Merge pull request #3392 from poettering/assorted-stuffZbigniew Jędrzejewski-Szmek2016-06-041-1/+2
|\ | | | | Assorted stuff
| * dhcp-server: fix integer underflowLennart Poettering2016-05-301-1/+2
| | | | | | | | | | Let's better ignore an invalid message size parameter, than assume ridiculously larger sizes.
* | network: fix wrong include of source file "ether-addr-util.c" (#3402)Thomas Haller2016-05-311-1/+1
|/ | | Fixes: 9ed8b06c9be4a5efae432d5cf4b1c47d03e6f107
* Merge pull request #3360 from glaubitz/masterZbigniew Jędrzejewski-Szmek2016-05-281-5/+5
|\ | | | | Fix multiple unaligned accesses in test-dns-packet and sd-dhcp-server.
| * networkd/sd-dhcp-server: Fix unaligned access in parse_request().John Paul Adrian Glaubitz2016-05-271-5/+5
| |
* | ipv4ll: shorten some checks by using IN_SET a bitLennart Poettering2016-05-261-11/+2
| | | | | | | | | | | | As suggested: https://github.com/systemd/systemd/pull/3328#discussion-diff-64285764
* | sd-ndisc: small coding style fixesLennart Poettering2016-05-261-3/+2
| | | | | | | | | | | | 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.
* | sd-ndisc: add more whitespaceLennart Poettering2016-05-261-10/+12
| | | | | | | | Whitespace doesn't hurt and helps structuring things.
* | sd-ndisc: stop discovery properly when something failsLennart Poettering2016-05-261-7/+13
| |
* | sd-ndisc: rework size checking in ndisc_ra_parse()Lennart Poettering2016-05-261-8/+7
| | | | | | | | | | | | | | | | 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.
* | sd-ndisc: simplify clamping of router "pref" parameterLennart Poettering2016-05-261-7/+1
| |
* | sd-ndisc: append "event_source" to event source objects stored in structuresLennart Poettering2016-05-261-17/+15
| | | | | | | | | | Otherwise it gets too confusing whether "timeout" refers to an event source or just a timeout time specification.
* | sd-ndisc: add log_ndisc_errno() macro, to complement log_ndisc() like elsewhereLennart Poettering2016-05-261-5/+5
| | | | | | | | Also make use of it where appropriate.
* | sd-ndisc: use the right object to pass to log_ndisc()Lennart Poettering2016-05-261-2/+2
| | | | | | | | | | | | | | 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.
* | sd-ndisc: Typo fix: s/advertisment/advertisement/Lennart Poettering2016-05-261-6/+6
| |
* | ipv4acd: rename "ll" parameter to "acd" everywhereLennart Poettering2016-05-261-152/+152
| | | | | | | | | | Appears to be a (confusing) left-over from copy/paste when this still was ipv4ll code.
* | sd-ipv4ll: add a bit of logging to IPv4LL tooLennart Poettering2016-05-261-0/+8
| |
* | sd-ipv4acd: drop IPV4ACD_NETWORK definitionLennart Poettering2016-05-261-6/+3
| | | | | | | | Appears to be a copy/paste mistake from sd-ipv4ll. Let's get rid of this.
* | ipv4acd: rework how we pick ipv4ll addressesLennart Poettering2016-05-261-70/+61
| | | | | | | | | | | | | | | | 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.
* | ipv4ll: change "seed" parameter to be uint64_tLennart Poettering2016-05-262-6/+4
| | | | | | | | | | 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.
* | ipv4acd: make sure our event handler callbacks never check uninitialized "r" ↵Lennart Poettering2016-05-261-18/+18
| | | | | | | | for errors
* | ipv4acd: normalize time types to usec_tLennart Poettering2016-05-261-27/+24
| | | | | | | | | | | | 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.
* | ipv4acd: in case the state engine is reused, reset n_conflict timer to 0Lennart Poettering2016-05-261-0/+1
| |
* | ipv4acd: no need to memcpy() where assignment sufficesLennart Poettering2016-05-261-1/+1
| |
* | ipv4acd: introduce new "started" stateLennart Poettering2016-05-261-1/+3
| | | | | | | | | | | | | | | | 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.
* | ipv4acd: rename ipv4acd_stop() → ipv4acd_reset()Lennart Poettering2016-05-261-51/+43
| | | | | | | | | | | | | | | | 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.
* | ipv4acd: add "_event_source" suffix to event source objectsLennart Poettering2016-05-261-24/+21
| | | | | | | | | | Otherwise the field "receive_message" is a bit too confusing, as it suggests it actually stores a message object of some kind.
* | ipv4acd: make the iteration and conflict fields unsignedLennart Poettering2016-05-261-12/+17
| | | | | | | | | | | | | | 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.
* | ipv4l-{acd,ll}: make sure ipv4 addresses are unsignedLennart Poettering2016-05-262-15/+9
| | | | | | | | And some other minor fixes.
* | ipv4acd: library code should never logLennart Poettering2016-05-261-24/+14
| | | | | | | | Or actually, not at any level higher than debug.
* | sd-ipv4{acl,ll}: don't make use of RefCnt objectsLennart Poettering2016-05-262-7/+14
| | | | | | | | | | | | 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.