summaryrefslogtreecommitdiff
path: root/src/basic
AgeCommit message (Collapse)Author
2016-02-23Merge pull request #2717 from keszybz/networkctl-prettificationLennart Poettering
Networkctl prettification
2016-02-23basic: simplify ether_addr_is_nullZbigniew Jędrzejewski-Szmek
2016-02-23Fix two typosZbigniew Jędrzejewski-Szmek
2016-02-23architecture.h: remove PROC_CPUINFO_MODELDaniel Mack
This was only needed for bootchart, so it can go now.
2016-02-23Merge pull request #2709 from vcaputo/normalize_inc_dec_usageMartin Pitt
tree-wide: make ++/-- usage consistent WRT spacing
2016-02-22tree-wide: make ++/-- usage consistent WRT spacingVito Caputo
Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
2016-02-22resolved: fix notification iteration logic when transactions are completedLennart Poettering
When a transaction is complete, and we notify its owners, make sure we deal correctly with the requesters removing themselves from the list of owners while we continue iterating. This was previously already dealt with with transactions that require other transactions for DNSSEC purposes, fix this for other possibly transaction owners too now. Since iterating through "Set" objects is not safe regarding removal of entries from it, rework the logic to use two Sets, and move each entry we notified from one set to the other set before we dispatch the notification. This move operation requires no additional memory, and enables us to ensure that we don't notify any object twice. Fixes: #2676
2016-02-22hashmap: use void* and uint8_t* for generic pointersLennart Poettering
As suggested by CODING_STYLE we should use "void*" as type for generic memory, and uint8_t* for generic bytes. Hence use that instead of "char*", which should really be used only for strings these days.
2016-02-22util-lib: simplify personality() string matchingLennart Poettering
2016-02-22virt: make sure we don't ignore some errorsLennart Poettering
2016-02-22util-lib: support various ppc archs in personality logicLennart Poettering
2016-02-22util-lib: use the architecture ids from architecture.h for personalitiesLennart Poettering
We have this ids, hence let's use them universally.
2016-02-22build-sys: move shared/architecture.[ch] into basic/Lennart Poettering
After all, it is pretty generic, has no external deps besides libc, and is very similar to virt.[ch] which is also in basic/
2016-02-22Merge pull request #2685 from poettering/lldp-fixes2Tom Gundersen
lldp fixes, second iteration
2016-02-22Merge pull request #2695 from mustrumr/fix-calendarspec-skipLennart Poettering
calendarspec: fix find_next skipping times
2016-02-22Merge pull request #2694 from zonque/proxyarp-missingLennart Poettering
missing.h: Explicitly check for IFLA_BRPORT_PROXYARP
2016-02-22calendarspec: fix find_next skipping timesHristo Venev
reset usec when bumping hours/minutes
2016-02-22missing.h: Explicitly check for IFLA_BRPORT_PROXYARPDaniel Mack
RHEL explicitly disables IFLA_BRPORT_PROXYARP by renaming the enum value. In order to support unpatched builds, we have two options: a) redefine the enum value through missing.h and ignore the fact that it is really unsupported, or b) omit that enum value on rtnl_prot_info_bridge_port_types[] As we are not actually using this netlink type anywhere, and because it is only hooked up for the sake of completeness, this patch opts for the former.
2016-02-21Merge pull request #2688 from poettering/calendar-fix-2678Zbigniew Jędrzejewski-Szmek
A fix for #2678
2016-02-21util-lib: fix returned error codeLennart Poettering
Make sure we propagate errors properly.
2016-02-21util-lib: add (void) cast to indicate that we don't care about the ↵Lennart Poettering
normalization success After all, we verify that every calendar part is not out of bounds later on, and it's fully OK if the normalization has no effect.
2016-02-21networkd: add basic LLDP transmission supportLennart Poettering
Let's add some minimalistic LLDP sender support. The idea is that this is either on or off, and all fields determined automatically rather than configured explicitly.
2016-02-21sd-lldp: filter out LLDP messages coming from our own MAC addressLennart Poettering
Let's not get confused should we be connected to some bridge that mirrors back our packets.
2016-02-20time-util: check for overflow in conversion from ts to nsec_tZbigniew Jędrzejewski-Szmek
CID #1320855.
2016-02-20tree-wide: place #pragma once at the same place everywhereLennart Poettering
Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
2016-02-20sd-lldp: move ETHERTYPE_LLDP to missing.hLennart Poettering
After all, most ETHERTYPE variables are defined in the system headers, hence define these where we defined all other fill-ins for system headers.
2016-02-19Merge pull request #2666 from keszybz/coverity-fixesZbigniew Jędrzejewski-Szmek
Coverity fixes
2016-02-19Use (void) to silenc coverity on proc title changesZbigniew Jędrzejewski-Szmek
This is a cosmetic best-effort thing anyway.
2016-02-19Merge pull request #2661 from nwmcsween/nwmcsweenDaniel Mack
Include and internal struct member fixes.
2016-02-18time-util: rewrite check in a way that does not confuse gccZbigniew Jędrzejewski-Szmek
gcc thinks that multiplier might be unitialized. Split out the inner loop to make the function easier to grok.
2016-02-18basic/strbuf: do not call bsearch with a null argumentZbigniew Jędrzejewski-Szmek
Das ist verboten! src/basic/strbuf.c:162:23: runtime error: null pointer passed as argument 2, which is declared to never be null
2016-02-18Remove/add (un)needed includesNathan McSween
2016-02-18Merge pull request #2644 from 0xAX/check-alloc-overflow-macroZbigniew Jędrzejewski-Szmek
alloc-util: extract overflow check into inline function
2016-02-19alloc-util: cleanupsAlexander Kuleshov
This patch contains a set of little cleanups for alloc-util.h: 1. The malloc_multiply(), realloc_multiply() and memdup_multiply() functions check allocation related parameters on overflow. Let's move them to the separate size_multiply_overflow() function for simplicity, code duplication prevention and possible reuse in future. 2. use SIZE_MAX from stdlib instead of ((size_t) - 1) to be more clear. 3. The 'a'/'b' variables are renamed to 'size' and 'need' to be more clear.'
2016-02-17Merge pull request #2640 from keszybz/dnssec-work-3Lennart Poettering
resolve: dumping of binary packets
2016-02-16Use provided buffer in dns_resource_key_to_stringZbigniew Jędrzejewski-Szmek
When the buffer is allocated on the stack we do not have to check for failure everywhere. This is especially useful in debug statements, because we can put dns_resource_key_to_string() call in the debug statement, and we do not need a seperate if (log_level >= LOG_DEBUG) for the conversion. dns_resource_key_to_string() is changed not to provide any whitespace padding. Most callers were stripping the whitespace with strstrip(), and it did not look to well anyway. systemd-resolve output is not column aligned anymore. The result of the conversion is not stored in DnsTransaction object anymore. It is used only for debugging, so it seems fine to generate it when needed. Various debug statements are extended to provide more information.
2016-02-16Merge pull request #2623 from poettering/networkd-fixesZbigniew Jędrzejewski-Szmek
Networkd, resolved, build-sys fixes
2016-02-16Merge pull request #2626 from poettering/fionread-fixLennart Poettering
networkd: FIONREAD is not reliable on some sockets
2016-02-16build-sys: fix type detectionLennart Poettering
Before this patch existence of char16_t, char32_t, key_serial_t was checked with AC_CHECK_DECLS() which doesn't actually work for types. Correct this to use AC_CHECK_TYPES() instead. Also, while we are at it, change the check for memfd_create() to use AC_CHECK_DECLS() instead of AC_CHECK_FUNCS(). This is a better choice, since a couple of syscalls are defined by glibc but not exported in the header files (pivot_root() for example), and we hence should probably be more picky with memfd_create() too, which glibc might decide to expose one day, but not necessarily in the headers too.
2016-02-16networkd: FIONREAD is not reliable on some socketsLennart Poettering
Fixes: #2457
2016-02-15time-util: Rename and fix call of deserialize_timestamp_value()Benjamin Robin
The deserialize_timestamp_value() is renamed timestamp_deserialize() to be more consistent with dual_timestamp_deserialize() And add the NULL check back on realtime and monotonic
2016-02-15Merge pull request #2611 from 0xAX/deserialize-clkidLennart Poettering
time-util: introduce deserialize_timestamp_value()
2016-02-16time-util: introduce deserialize_timestamp_value()Alexander Kuleshov
The time-util.c provides dual_timestamp_deserialize() function to convert value to usec_t and set it as value of ts->monotonic and ts->realtime. There are some places in code which do the same but only for one clockid_t (realtime or monotonic), when dual_timestamp_deserialize() sets value of both. This patch introduces the deserialize_timestamp_value() which converts a given value to usec_t and write it to a given timestamp.
2016-02-15Merge pull request #2596 from keszybz/move-activate-to-binLennart Poettering
Move activate to bin, extend --fdnames functionality
2016-02-15missing.h: define IFLA_EXT_MASKRabin Vincent
We already define IFLA_PROMISCUITY and some other of these masks in order to allow building with older headers. Define IFLA_EXT_MASK too, which was added in the same kernel version as IFLA_PROMISCUITY (v3.10).
2016-02-13basic/strv: fix strv_join for first empty argumentZbigniew Jędrzejewski-Szmek
Empty strings were ignored in strv_join, but only if they were at the beginning of the string. Empty strings after at least one non-empty item were treated normally. Previously: {"x"} → "x" {"x", ""} → "x" {"x", "", ""} → "x::" {""} → "" {"", ""} → "" {"", "", ""} → "" {"", "x"} → "x" {"", "x", ""} → "x:" Now: {"x"} → "x" {"x", ""} → "x" {"x", "", ""} → "x::" {""} → "" {"", ""} → ":" {"", "", ""} → "::" {"", "x"} → ":x" {"", "x", ""} → ":x:"
2016-02-13Merge pull request #2603 from poettering/drop-compat-libsZbigniew Jędrzejewski-Szmek
Some spring cleaning
2016-02-13tree-wide: make more global variables staticLennart Poettering
let's export as little as we can
2016-02-13util: drop two unused calls from src/basic/Lennart Poettering
2016-02-13build-sys: drop Makefile symlink in src/basic/linuxLennart Poettering
The dir is not used otherwise, hence let's drop the Makefile, so that the dir stops to exist, too.