Lennart Poettering [Sun, 21 Feb 2016 19:38:39 +0000 (20:38 +0100)]
sd-lldp: beef up callback logic
Instead of just notifying about the fact that something changed in the
database, actually inform the callback what precisely changed. This is useful,
so that the LLDP tx logic can be put into "fast" mode as soon as a previously
unknown peer appears, as suggested by the LLDP spec.
Lennart Poettering [Sun, 21 Feb 2016 13:31:51 +0000 (14:31 +0100)]
networkctl: ellipsize long LLDP fields in table output
Lennart Poettering [Sun, 21 Feb 2016 13:27:06 +0000 (14:27 +0100)]
networkctl: add missing newline to printf() format string
Lennart Poettering [Sun, 21 Feb 2016 13:06:08 +0000 (14:06 +0100)]
network: turn on LLDP tx+rx for the default container network configuration
Containers are relatively trusted and the veth tunnels are small networks,
hence let's turn on LLDP both ways for them.
Lennart Poettering [Sun, 21 Feb 2016 13:14:08 +0000 (14:14 +0100)]
networkd: add basic LLDP transmission support
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.
Lennart Poettering [Sun, 21 Feb 2016 13:11:34 +0000 (14:11 +0100)]
sd-lldp: filter out LLDP messages coming from our own MAC address
Let's not get confused should we be connected to some bridge that mirrors back
our packets.
Lennart Poettering [Sat, 20 Feb 2016 23:10:55 +0000 (00:10 +0100)]
import: don't claim we had copied a settings file if we didn't
Lennart Poettering [Sat, 20 Feb 2016 22:45:19 +0000 (23:45 +0100)]
man: update references to fedora cloud image
We are now at F23, hence let's use that as example.
Lennart Poettering [Sat, 20 Feb 2016 22:27:57 +0000 (23:27 +0100)]
networkd: make a couple of functions static
These functions are nowadays used only within networkd-link.c, hence ther's no
point in littering our public namespace with them.
Lennart Poettering [Sat, 20 Feb 2016 21:35:02 +0000 (22:35 +0100)]
networkd: rework when LLDP reception is enabled
Being on the link-layer LLDP is nothing we should turn on only when there's a
link beat. Instead, turn it on, whenever the iface is UP regardless if there's
a link beat or not. This closes the race between a link beat being available
and us subscribing to LLDP as a result.
Lennart Poettering [Sat, 20 Feb 2016 21:25:43 +0000 (22:25 +0100)]
networkctl: print a nice warning when networkd isn't running
Lennart Poettering [Sat, 20 Feb 2016 21:12:14 +0000 (22:12 +0100)]
networkctl: if there's no data from networkd about an iface show as "unmanaged"
After all, if we know that an interface exists but networkd did not store any
info about it, then it's definitely unmanaged by it.
(Note that we add this fix-up to networkctl, and not to sd-network, simply
because a missing file might also be result of the interface not existing.)
Lennart Poettering [Sat, 20 Feb 2016 21:06:12 +0000 (22:06 +0100)]
sd-network: use xsprintf() instead of asprintf() where we can
Lennart Poettering [Sat, 20 Feb 2016 20:34:38 +0000 (21:34 +0100)]
networkctl: add a couple of (void) casts
Where we knowingly ignore possible error results, let's cast to void.
Lennart Poettering [Fri, 19 Feb 2016 19:43:03 +0000 (20:43 +0100)]
networkd: rework how carrier bindings are serialized
Instead of serializing the interface name, expose the interface index, since
that's the only stable identifier.
Lennart Poettering [Fri, 19 Feb 2016 18:59:32 +0000 (19:59 +0100)]
networkd: turn on LLDP reception by default, in "routers-only" mode
This way "networkctl status" becomes a bit more useful by default, as router
information is just visible, without any further configuration.
LLDP reception is fully passive and relatively low simple and low traffic,
hence this should be safe to enable by default.
Lennart Poettering [Fri, 19 Feb 2016 18:50:14 +0000 (19:50 +0100)]
networkctl: extend "networkctl status" per-interface output to include LLDP info
This adds a small and useful field to the "systemctl status" output: the
router(s) the interface is connected to as reported via LLDP. Example output:
● 2: enp0s25
Link File: /usr/lib/systemd/network/99-default.link
Type: ether
State: degraded (configured)
Path: pci-0000:00:19.0
Driver: e1000e
Connected To: GS1900 on port 2 (foobar)
i.e. the last line is the relevant one.
Lennart Poettering [Fri, 19 Feb 2016 18:24:16 +0000 (19:24 +0100)]
networkctl: make use of xsprintf() where we can
Lennart Poettering [Fri, 19 Feb 2016 18:21:30 +0000 (19:21 +0100)]
networkctl: simplify networkctl
Move decode_and_sort_links() into acquire_info_all() which is the only place
this is used. The result is then nicely symmetric to acquire_info_strv().
Lennart Poettering [Fri, 19 Feb 2016 18:18:12 +0000 (19:18 +0100)]
networkctl: rework interface data acquisition
Let's always use the same calls to acquire interface data. Specifically port
"networkctl status" to use acquire_link_info_strv() and acquire_link_info_all()
like the other calls.
Lennart Poettering [Fri, 19 Feb 2016 17:57:11 +0000 (18:57 +0100)]
networkctl: extend "networkctl list" and "networctl lldp" to optionally take interface names
This way, the output may be reduced to only show data about the specified
interfaces.
Lennart Poettering [Fri, 19 Feb 2016 17:26:18 +0000 (18:26 +0100)]
networkctl: add new call that unifies link data acquisition between "status" and "lldp" verbs
Lennart Poettering [Fri, 19 Feb 2016 17:21:17 +0000 (18:21 +0100)]
networkctl: fix dispatch_verb() table
VERB_DEFAULT may only appear once.
Lennart Poettering [Fri, 19 Feb 2016 17:20:40 +0000 (18:20 +0100)]
networkctl: split out system status stuff into its own function
Lennart Poettering [Fri, 19 Feb 2016 16:58:52 +0000 (17:58 +0100)]
sd-lldp: rework sd-lldp API
This reworks the sd-lldp substantially, simplifying things on one hand, and
extending the logic a bit on the other.
Specifically:
- Besides the sd_lldp object only one other object is maintained now,
sd_lldp_neighbor. It's used both as storage for literal LLDP packets, and for
maintainging info about peers in the database. Separation between packet, TLV
and chassis data is not maintained anymore. This should be a major
simplification.
- The sd-lldp API has been extended so that a couple of per-neighbor fields may
be queried directly, without iterating through the object. Other fields that
may appear multiple times, OTOH have to be iterated through.
- The maximum number of entries in the neighbor database is now configurable
during runtime.
- The generation of callbacks from sd_lldp objects is more restricted:
callbacks are only invoked when actual data changed.
- The TTL information is now hooked with a timer event, so that removals from
the neighbor database due to TTLs now result in a callback event.
- Querying LLDP neighbor database will now return a strictly ordered array, to
guarantee stability.
- A "capabilities" mask may now be configured, that selects what type of LLDP
neighbor data is collected. This may be used to restrict collection of LLDP
info about routers instead of all neighbors. This is now exposed via
networkd's LLDP= setting.
- sd-lldp's API to serialize the collected data to text files has been removed.
Instead, there's now an API to extract the raw binary data from LLDP neighbor
objects, as well as one to convert this raw binary data back to an LLDP
neighbor object. networkd will save this raw binary data to /run now, and the
client side can simply parse the information.
- support for parsing the more exotic TLVs has been removed, since we are not
using that. Instead there are now APIs to extract the raw data from TLVs.
Given how easy it is to parse the TLVs clients should do so now directly
instead of relying on our APIs for that.
- A lot of the APIs that parse out LLDP strings have been simplified so that
they actually return strings, instead of char arrays with a length. To deal
with possibly dangerous characters the strings are escaped if needed.
- APIs to extract and format the chassis and port IDs as strings has been
added.
- lldp.h has been simplified a lot. The enums are anonymous now, since they
were never used as enums, but simply as constants. Most definitions we don't
actually use ourselves have eben removed.
Lennart Poettering [Thu, 18 Feb 2016 21:51:23 +0000 (22:51 +0100)]
core: exclude .slice units from "systemctl isolate"
Fixes: #1969
Lennart Poettering [Thu, 18 Feb 2016 21:49:48 +0000 (22:49 +0100)]
networkd: fix logging of error codes
Lennart Poettering [Thu, 18 Feb 2016 21:49:02 +0000 (22:49 +0100)]
networkd: enable LLDP only on ethernet
Lennart Poettering [Thu, 18 Feb 2016 21:47:34 +0000 (22:47 +0100)]
sd-netlink: fix ifi_iftype type
The iftype is an unsigned short, and not just an unsigned.
Lennart Poettering [Thu, 18 Feb 2016 21:45:22 +0000 (22:45 +0100)]
sd-lldp: fix how we create the LLDP listening socket
Specifiy the ethernet family, and make sure we se the O_CLOEXEC and O_NONBLOCK
bits how we should for all fds.
Lennart Poettering [Tue, 16 Feb 2016 19:05:15 +0000 (20:05 +0100)]
tree-wide: place #pragma once at the same place everywhere
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.
Lennart Poettering [Tue, 16 Feb 2016 18:47:25 +0000 (19:47 +0100)]
sd-lldp: simplify lldp_network_bind_raw_socket() a bit
Let's constify the filter program, drop a few includes and structure
definitions.
Lennart Poettering [Tue, 16 Feb 2016 18:46:28 +0000 (19:46 +0100)]
sd-lldp: move ETHERTYPE_LLDP to missing.h
After all, most ETHERTYPE variables are defined in the system headers, hence
define these where we defined all other fill-ins for system headers.
Lennart Poettering [Tue, 16 Feb 2016 18:36:47 +0000 (19:36 +0100)]
test-lldp: fix error checking expressions
Lennart Poettering [Tue, 16 Feb 2016 18:33:36 +0000 (19:33 +0100)]
libsystemd-network: sd-event uses 64bit priorities, expose them in the APIs as such
Lennart Poettering [Tue, 16 Feb 2016 18:26:40 +0000 (19:26 +0100)]
sd-lldp: drop "port" object
Let's just keep the few parts we actually need of it in the main sd_lldp
object, so that we can simplify things quite a bit.
While we are at it, remove ifname and mac fields which we make no use of
whatsoever.
Lennart Poettering [Tue, 16 Feb 2016 18:05:35 +0000 (19:05 +0100)]
sd-lldp: drop keeping of statistics
We don't expose them, and they are only of questionnable use.
Lennart Poettering [Tue, 16 Feb 2016 17:58:51 +0000 (18:58 +0100)]
libsystemd-network: don't abbreviate "callback" as "cb" needlessly
This isn't an excercise in creating APIs that are hard to understand, hence
let's call a callback a callback.
Lennart Poettering [Tue, 16 Feb 2016 17:56:37 +0000 (18:56 +0100)]
sd-lldp: drop state field
There's really no point in maintaining a state, the state machine is trivial,
and we actually never look at the state anyway, we just keep updating it.
Daniel Mack [Sat, 20 Feb 2016 11:27:48 +0000 (12:27 +0100)]
Merge pull request #2675 from samueltardieu/llmnr-typo
Fix typo on systemd-resolved log message
Samuel Tardieu [Sat, 20 Feb 2016 07:54:57 +0000 (08:54 +0100)]
systemd-resolved: fix typo on log message
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2016 20:18:40 +0000 (15:18 -0500)]
Merge pull request #2666 from keszybz/coverity-fixes
Coverity fixes
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2016 20:13:03 +0000 (15:13 -0500)]
Merge pull request #2670 from hbrueckner/for-upstream
udev/path_id: correct segmentation fault due to missing NULL check
Daniel Mack [Fri, 19 Feb 2016 14:52:43 +0000 (15:52 +0100)]
Merge pull request #2668 from samueltardieu/systemd-resolve-manual-typo
Fix typo in systemd-resolve man page
Hendrik Brueckner [Fri, 19 Feb 2016 14:21:18 +0000 (15:21 +0100)]
udev/path_id: correct segmentation fault due to missing NULL check
Running "udevadm test-builtin path_id /sys/devices/platform/" results
in a segmentation fault.
The problem is that udev_device_get_subsystem(dev) might return NULL
in a streq() call. Solve this problem by using streq_ptr() instead.
Samuel Tardieu [Fri, 19 Feb 2016 13:42:38 +0000 (14:42 +0100)]
systemd-resolve: fix typo in man page
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2016 12:35:35 +0000 (07:35 -0500)]
Use (void) to silenc coverity on proc title changes
This is a cosmetic best-effort thing anyway.
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2016 12:27:43 +0000 (07:27 -0500)]
resolved: fix NULL dereference in debug stmt
CID #1351544, #1351545.
Daniel Mack [Fri, 19 Feb 2016 11:29:23 +0000 (12:29 +0100)]
Merge pull request #2661 from nwmcsween/nwmcsween
Include and internal struct member fixes.
Daniel Mack [Fri, 19 Feb 2016 11:23:43 +0000 (12:23 +0100)]
Merge pull request #2660 from keszybz/memleaks-and-ubsan
Memleaks and ubsan
Daniel Mack [Fri, 19 Feb 2016 11:19:18 +0000 (12:19 +0100)]
Merge pull request #2662 from keszybz/activate-setenv
activate: fix -E option parsing
Martin Pitt [Fri, 19 Feb 2016 06:50:50 +0000 (07:50 +0100)]
Merge pull request #2648 from keszybz/dnssec-work
Better support for DANE, shell completion
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2016 02:54:31 +0000 (21:54 -0500)]
activate: fix -E option parsing
Fixes #2658.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Feb 2016 18:15:34 +0000 (13:15 -0500)]
time-util: rewrite check in a way that does not confuse gcc
gcc thinks that multiplier might be unitialized. Split out the inner
loop to make the function easier to grok.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 23:59:27 +0000 (18:59 -0500)]
test-hashmap: fix undefined behaviour on string constants
The test was failing at -O2+ with gcc 5.3 and 6.0.
"val1" == "val1" and "val1" != "val1" are both valid.
http://stackoverflow.com/questions/4843640/why-is-a-a-in-c
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 22:37:17 +0000 (17:37 -0500)]
journal/catalog: fix memory leaks
Various buffers were lost because finish_item() either consumed
the buffer or allocated a new one (if an entry with the same key existed).
The caller would simply forget the buffer in either case.
Also add a check for the case when a valid identifier is followed by
an empty body. We should not allow this.
Also be more consistent in error handling and always print an error
message.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 22:33:10 +0000 (17:33 -0500)]
basic/strbuf: do not call bsearch with a null argument
Das ist verboten!
src/basic/strbuf.c:162:23: runtime error: null pointer passed as argument 2,
which is declared to never be null
Nathan McSween [Thu, 18 Feb 2016 23:35:22 +0000 (23:35 +0000)]
Don't use internal struct member names
Nathan McSween [Thu, 18 Feb 2016 23:34:30 +0000 (23:34 +0000)]
Remove/add (un)needed includes
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 20:32:22 +0000 (15:32 -0500)]
Merge pull request #2644 from 0xAX/check-alloc-overflow-macro
alloc-util: extract overflow check into inline function
Alexander Kuleshov [Tue, 16 Feb 2016 17:51:43 +0000 (23:51 +0600)]
alloc-util: cleanups
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.'
Martin Pitt [Thu, 18 Feb 2016 18:20:14 +0000 (19:20 +0100)]
Merge pull request #2621 from keszybz/wheel-group
build-sys: allow wheel group name to be specified
Zbigniew Jędrzejewski-Szmek [Tue, 16 Feb 2016 23:17:01 +0000 (18:17 -0500)]
systemd-resolve: initial shell completion
v2:
- use /sys/class/net to list interfaces,
also copy the same code to systemd-nspawn
v3:
- do not propose "any" twice for --type
Zbigniew Jędrzejewski-Szmek [Wed, 17 Feb 2016 01:55:23 +0000 (20:55 -0500)]
resolve: also allow SSHFP payload to be exported
Zbigniew Jędrzejewski-Szmek [Wed, 17 Feb 2016 01:36:10 +0000 (20:36 -0500)]
resolve: print TLSA packets in hexadecimal
https://tools.ietf.org/html/rfc6698#section-2.2 says:
> The certificate association data field MUST be represented as a string
> of hexadecimal characters. Whitespace is allowed within the string of
> hexadecimal characters
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 02:08:57 +0000 (21:08 -0500)]
systemd-resolve: easy querying of TLSA records
$ systemd-resolve --tlsa fedoraproject.org
_443._tcp.fedoraproject.org IN TLSA 0 0 1 GUAL5bejH7czkXcAeJ0vCiRxwMnVBsDlBMBsFtfLF8A=
-- Cert. usage: CA constraint
-- Selector: Full Certificate
-- Matching type: SHA-256
$ systemd-resolve --tlsa=tcp fedoraproject.org:443
_443._tcp.fedoraproject.org IN TLSA 0 0 1 GUAL5bejH7czkXcAeJ0vCiRxwMnVBsDlBMBsFtfLF8A=
...
$ systemd-resolve --tlsa=udp fedoraproject.org
_443._udp.fedoraproject.org: resolve call failed: '_443._udp.fedoraproject.org' not found
v2:
- use uint16_t
- refuse port 0
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 15:24:16 +0000 (10:24 -0500)]
Merge pull request #2646 from evverx/fix-2637
Fix #2637 (doubled specifier expansion in ExecStart=)
Martin Pitt [Thu, 18 Feb 2016 15:11:03 +0000 (16:11 +0100)]
Merge pull request #2653 from keszybz/test-dns-domain
build-sys: remove duplicated entry in tests
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2016 13:30:18 +0000 (08:30 -0500)]
build-sys: remove duplicated entry in tests
test-dns-domain should be built and run even without ENABLE_RESOLVED.
Evgeny Vereshchagin [Wed, 17 Feb 2016 22:32:36 +0000 (22:32 +0000)]
core: revert "core: resolve specifier in config_parse_exec()"
This reverts commit
cb48dfca6a8bc15d9081651001a16bf51e03838a.
Exec*-settings resolve specifiers twice:
%%U -> config_parse_exec [
cb48dfca6a8] -> %U -> service_spawn -> 0
Fixes #2637
Martin Pitt [Thu, 18 Feb 2016 09:33:39 +0000 (10:33 +0100)]
Merge pull request #2652 from filbranden/testsresolved1
Do not build tests that depend on resolved when it has been disabled
Filipe Brandenburger [Thu, 18 Feb 2016 08:39:38 +0000 (00:39 -0800)]
build-sys: Do not build tests that depend on resolved when it has been disabled
If ./configure --disable-resolved has been used, do not try to build
test-dns-packet and test-resolve-tables which depend on it.
Previously, the SOURCES, LIBS and LDADDs for these tests were made conditional
while the main rules for them weren't, causing build failures trying to build a
binary with no sources.
This was uncovered when trying to build udeb for systemd in CI, which uses
--disable-resolved for a minimal build, which uncovered the issue.
Fixes #2651.
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2016 16:08:26 +0000 (11:08 -0500)]
build-sys: allow references to wheel group to be omitted
https://github.com/systemd/systemd/issues/2492
Evgeny Vereshchagin [Wed, 17 Feb 2016 22:20:56 +0000 (22:20 +0000)]
tests: add test for https://github.com/systemd/systemd/issues/2637
+ perl -e 'exit(!(qq{0} eq qq{\x25U}))'
exec-spec-interpolation.service: Main process exited, code=exited, status=1/FAILURE
exec-spec-interpolation.service: Unit entered failed state.
exec-spec-interpolation.service: Failed with result 'exit-code'.
PID: 11270
Start Timestamp: Wed 2016-02-17 22:21:31 UTC
Exit Timestamp: Wed 2016-02-17 22:21:31 UTC
Exit Code: exited
Exit Status: 1
Assertion 'service->main_exec_status.status == status_expected' failed at src/test/test-execute.c:65, function check(). Aborting.
Lennart Poettering [Wed, 17 Feb 2016 11:45:31 +0000 (12:45 +0100)]
Merge pull request #2640 from keszybz/dnssec-work-3
resolve: dumping of binary packets
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2016 23:22:11 +0000 (18:22 -0500)]
test-resolve-tables: verify that dns type/class length is within limits
DNS_TYPE_STRING_MAX causes a problem with the table autogeneration code,
change to _DNS_TYPE_STRING_MAX.
Zbigniew Jędrzejewski-Szmek [Sun, 14 Feb 2016 23:51:55 +0000 (18:51 -0500)]
Use provided buffer in dns_resource_key_to_string
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.
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2016 19:54:15 +0000 (14:54 -0500)]
Replace DNS_RESOURCE_KEY_NAME with a version which always returns "." for root
This fixes formatting of root domain in debug messages:
Old:
systemd-resolved[10049]: Requesting DS to validate transaction 19313 (., DNSKEY with key tag: 19036).
New:
systemd-resolved[10049]: Requesting DS to validate transaction 19313 (, DNSKEY with key tag: 19036).
Zbigniew Jędrzejewski-Szmek [Thu, 4 Feb 2016 02:37:11 +0000 (21:37 -0500)]
systemd-resolved: split out inner loop
With two nested loops and a switch statements, it's quite hard to
understand what break and continue mean.
Zbigniew Jędrzejewski-Szmek [Sun, 31 Jan 2016 05:06:49 +0000 (00:06 -0500)]
systemd-resolve: allow whole packets to be dumped in binary form
Zbigniew Jędrzejewski-Szmek [Thu, 28 Jan 2016 23:24:28 +0000 (18:24 -0500)]
systemd-resolve: allow keys to be dumped in binary form
$ systemd-resolve --raw --openpgp zbyszek@fedoraproject.org | pgpdump /dev/stdin
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2016 18:15:23 +0000 (13:15 -0500)]
systemd-resolve: reword --help output
The output didn't specify if the default for --cname/--search/--legend and
other options was yes or no. Change the description to be explicit about that.
Also make the --help output and man page closer.
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2016 18:53:18 +0000 (13:53 -0500)]
man: show output in example systemd-resolve commands
I think example output allows the reader of the man page to
see what functionlity is provided without running the commands
themselves. Specific values in the examples are bound to get out
of date but this is not a problem.
Zbigniew Jędrzejewski-Szmek [Tue, 16 Feb 2016 23:36:42 +0000 (18:36 -0500)]
Merge pull request #2623 from poettering/networkd-fixes
Networkd, resolved, build-sys fixes
Lennart Poettering [Tue, 16 Feb 2016 22:53:44 +0000 (23:53 +0100)]
Merge pull request #2626 from poettering/fionread-fix
networkd: FIONREAD is not reliable on some sockets
Lennart Poettering [Tue, 16 Feb 2016 19:22:07 +0000 (20:22 +0100)]
Merge pull request #2636 from 0xAX/not-edit-errno-manually
main: no need to set errno manually
Lennart Poettering [Tue, 16 Feb 2016 13:17:53 +0000 (14:17 +0100)]
resolved: make sure to normalize all domain names returned via the bus
Most domain names we deal with are normalized anyway (since we read them that
way from DNS packets), but some might not (because they are synthesized from
unnormalized configuration or so), hence make sure to normalize all names
before passing them out to clients, to be fully deterministic.
Note that internally we are process normalized and non-normalized names the
same way, and while comparing them ignore the differences due to unnormalized
names. However, that internal implementation detail really shouldn't spill out
the clients, hence make sure to clean it all up.
Lennart Poettering [Tue, 16 Feb 2016 13:03:47 +0000 (14:03 +0100)]
udev: fix cg_unified() return code checking
Fixes fall-out from
8b3aa503c171acdb9ec63484a8c50e2680d31e79.
Fixes: #2635
Lennart Poettering [Tue, 16 Feb 2016 12:18:36 +0000 (13:18 +0100)]
core: fix assertion check
Fixes: #2632
Lennart Poettering [Mon, 15 Feb 2016 20:25:33 +0000 (21:25 +0100)]
resolve: print a noisy warning if we show crypto keys that could not be authenticated
Doing DNS retrieval on non-authenticated crypt keys is useless, hence warn
loudly about it.
Lennart Poettering [Mon, 15 Feb 2016 18:11:18 +0000 (19:11 +0100)]
networkd: rework idle detection logic of networkd
This patch makes networkd stay around as long as there is more than just a
loopback interface around, or the loopback device isn't fully probed yet, or
the loopback device has a .network file attached.
In essence, this means networkd stays around now continously as it should,
unless it is running in some (container?) environment that really has no
interface except a loopback device.
Fixes #2577.
Lennart Poettering [Mon, 15 Feb 2016 18:06:01 +0000 (19:06 +0100)]
build-sys: fix type detection
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.
Lennart Poettering [Mon, 15 Feb 2016 17:40:02 +0000 (18:40 +0100)]
resolved: turn on DNSSEC by default, unless configured otherwise
Let's make sure DNSSEC gets more testing, by defaulting DNSSEC to
"allow-downgrade" mode. Since distros should probably not ship DNSSEC enabled
by default add a configure switch to disable this again.
DNSSEC in "allow-downgrade" mode should mostly work without affecting user
experience. There's one exception: some captive portal systems rewrite DNS in
order to redirect HTTP traffic to the captive portal. If these systems
implement DNS servers that are otherwise DNSSEC-capable (which in fact is
pretty unlikely, but still...), then this will result in the captive portal
being inaccessible. To fix this support in NetworkManager (or any other network
management solution that does captive portal detection) is required, which
simply turns off DNSSEC during the captive portal detection, and resets it back
to the default (i.e. on) after captive portal authentication is complete.
Alexander Kuleshov [Tue, 16 Feb 2016 12:42:45 +0000 (18:42 +0600)]
main: no need to set errno manually
If we are not PID 1 and started as init, we executing systemctl
with execv(). Here no need to set errno manually, because in a
failure case, because the execv() anyway will set errno depends
on a error.
Lennart Poettering [Tue, 16 Feb 2016 12:21:14 +0000 (13:21 +0100)]
Merge pull request #2630 from keszybz/systemctl-m-h
systemctl: fix style to avoid modification of array passed by caller
Lennart Poettering [Mon, 15 Feb 2016 21:50:01 +0000 (22:50 +0100)]
networkd: FIONREAD is not reliable on some sockets
Fixes: #2457
Zbigniew Jędrzejewski-Szmek [Tue, 16 Feb 2016 00:06:53 +0000 (19:06 -0500)]
systemctl: fix style to avoid modification of array passed by caller
Followup for
4524439edb7d.
Lennart Poettering [Mon, 15 Feb 2016 23:05:20 +0000 (00:05 +0100)]
Merge pull request #2628 from benjarobin/fix-pull-req-2611
time-util: Rename and fix call of deserialize_timestamp_value()
Benjamin Robin [Mon, 15 Feb 2016 22:26:34 +0000 (23:26 +0100)]
time-util: Rename and fix call of deserialize_timestamp_value()
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
Lennart Poettering [Mon, 15 Feb 2016 22:07:24 +0000 (23:07 +0100)]
Merge pull request #2622 from keszybz/systemctl-m-h
systemctl: include -M or -H arguments in the hint