summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-ipv4acd.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-261-2/+2
| | | | 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-261-6/+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.
* sd-network: don't needlessly abbreviate "callback" as "cb" in struct membersLennart Poettering2016-05-261-4/+4
| | | | | It's OK to abbreviate this in the local scope, but otherwise, let's not be needlessly terse.
* sd-network: rename "index" field of the various clients to "ifindex"Lennart Poettering2016-05-261-10/+10
| | | | | | | 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.
* sd-network: unify packet processing logic a bitLennart Poettering2016-05-261-0/+3
| | | | | Let's always check for errno being EAGAIN/EINTR the same way, and always log if we receive weirdly short packets.
* ipv4acd/ipv4ll: stop using read() on SOCK_DGRAM socketsLennart Poettering2016-05-221-8/+24
| | | | | | | | | | This is a follow-up to cf447cb62d01137f4cbd1cd14b83b88823542bbf. Let's generally follow the rule to not use read() on SOCK_DGRAM sockets, let's always use recv() on that. Also, don't abort IPV4ACD logic in case we read a short packet. Simply log and ignore.
* sd-ipv4acd: do not define ether_addr_is_nul() redundantlyLennart Poettering2016-05-221-9/+2
| | | | | we already have ether_addr_is_null() in ether-addr-util.h, let's use it here, too.
* sd-ipv4acd: drop HASH_KEY definition, as it is unusedLennart Poettering2016-05-221-2/+0
|
* tree-wide: minor formatting inconsistency cleanupsVito Caputo2016-02-231-1/+1
|
* libsystemd-network: sd-event uses 64bit priorities, expose them in the APIs ↵Lennart Poettering2016-02-201-1/+1
| | | | as such
* libsystemd-network: don't abbreviate "callback" as "cb" needlesslyLennart Poettering2016-02-201-2/+2
| | | | | This isn't an excercise in creating APIs that are hard to understand, hence let's call a callback a callback.
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2015-11-271-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* sd-*.h: clean up exported (or to-be-exported) header filesLennart Poettering2015-10-241-1/+1
| | | | | | | | | | | | | | | | | Exported header files should not include internal headers. Fix that. Exported header files should not use the bool type. So far we opted to stick to C89 for exported headers, and hence use "int" for bools in them. Continue to do so. Exported header files should have #include lines for everything they use including inttypes.h and sys/types.h, so that they may be included in any order. Exported header files should have C++ guards, hence add them. Exported header files should not use gcc extensions like #pragma once, get rid of it.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-4/+4
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* sd-ipv4acd: fix namespacingDavid Herrmann2015-09-221-3/+3
| | | | | Prefix all exported constants with SD_IPV4ACD to prevent namespacing conflicts.
* sd-ipv4acd: introduce new library split out from sd-ipv4llTom Gundersen2015-09-181-0/+529
This splits the Address Conflict Detection out of the Link Local library so that we can reuse it for DHCP and static addresses in the future. Implements RFC5227.