Zbigniew Jędrzejewski-Szmek [Thu, 27 Sep 2018 15:50:25 +0000 (17:50 +0200)]
networkd-routing-policy-rule.c: drop unnecessary check
set_get() already does that.
Yu Watanabe [Thu, 27 Sep 2018 15:10:26 +0000 (00:10 +0900)]
dhcp6: fix memleak
Let's drop client_set_lease() because just writing what it does in both
places is simpler.
Fixes #10157.
Yu Watanabe [Thu, 27 Sep 2018 14:48:51 +0000 (23:48 +0900)]
dhcp6: fix buffer size checking
Yu Watanabe [Thu, 27 Sep 2018 14:31:34 +0000 (23:31 +0900)]
dhcp6: use offsetof instead of sizeof
Yu Watanabe [Thu, 27 Sep 2018 09:04:59 +0000 (18:04 +0900)]
sd-dhcp-lease: fix memleaks
Yu Watanabe [Thu, 27 Sep 2018 09:04:08 +0000 (18:04 +0900)]
sd-dhecp-lease: use free_and_replace() at one more
Yu Watanabe [Thu, 27 Sep 2018 08:48:11 +0000 (17:48 +0900)]
network: fix memleak around Network.dhcp_vendor_class_identifier
Yu Watanabe [Thu, 27 Sep 2018 08:39:16 +0000 (17:39 +0900)]
network: fix alignment
Yu Watanabe [Thu, 27 Sep 2018 08:27:04 +0000 (17:27 +0900)]
network: strdup iif and oif when creating RoutingPolicyRule object
Yu Watanabe [Thu, 27 Sep 2018 08:26:04 +0000 (17:26 +0900)]
network: use TAKE_PTR() at one more place
Yu Watanabe [Wed, 26 Sep 2018 16:59:19 +0000 (01:59 +0900)]
network: fix memleak about routing policy
Yu Watanabe [Wed, 26 Sep 2018 16:52:04 +0000 (01:52 +0900)]
network: use structured initializer at one more place
Zbigniew Jędrzejewski-Szmek [Thu, 27 Sep 2018 06:21:20 +0000 (08:21 +0200)]
Merge pull request #10173 from poettering/sd-boot-utf
the utf8.c changes from PR #9437 (i.e. the boot counting PR)
Lennart Poettering [Wed, 26 Sep 2018 21:40:39 +0000 (23:40 +0200)]
nspawn: when --quiet is passed, simply downgrade log messages to LOG_DEBUG (#10181)
With this change almost all log messages that are suppressed through
--quiet are not actually suppressed anymore, but simply downgraded to
LOG_DEBUG. Previously we did it this way for some log messages and fully
suppressed them for others. With this it's pretty much systematic.
Inspired by #10122.
Susant Sahani [Sat, 16 Sep 2017 18:36:56 +0000 (00:06 +0530)]
udev/net: add support for the equivalent of "ethtool advertise" to .link files
This work adds support for the equivalent of "ethtool advertise" to .link files?
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030112.html
Franck Bui [Tue, 25 Sep 2018 13:25:08 +0000 (15:25 +0200)]
emergency: make sure console password agents don't interfere with the emergency shell
If for any reason local-fs.target fails at startup while a password is
requested by systemd-cryptsetup@.service, we end up with the emergency shell
competing with systemd-ask-password-console.service for the console.
This patch makes sure that:
- systemd-ask-password-console.service is stopped before entering in emergency
mode so it won't make any access to the console while the emergency shell is
running.
- systemd-ask-password-console.path is also stopped so any attempts to restart
systemd-cryptsetup in the emergency shell won't restart
systemd-ask-password-console.service and kill the emergency shell.
- systemd-ask-password-wall.path is stopped so
systemd-ask-password-wall.service won't be started as this service pulls
the default dependencies in.
Fixes: #10131
Evgeny Vereshchagin [Mon, 17 Sep 2018 07:12:38 +0000 (07:12 +0000)]
nspawn: chown() the legacy hierarchy when it's used in a container
This is a follow-up to
720f0a2f3c928cc9379501a52146be9fbb4d9be2.
Closes https://github.com/systemd/systemd/issues/10026
Closes https://github.com/systemd/systemd/issues/9563
Anita Zhang [Wed, 19 Sep 2018 19:03:01 +0000 (12:03 -0700)]
Make Watchdog Signal Configurable
Allows configuring the watchdog signal (with a default of SIGABRT).
This allows an alternative to SIGABRT when coredumps are not desirable.
Appropriate references to SIGABRT or aborting were renamed to reflect
more liberal watchdog signals.
Closes #8658
Lennart Poettering [Wed, 26 Sep 2018 13:56:32 +0000 (15:56 +0200)]
Merge pull request #10158 from keszybz/seccomp-log-tightening
Seccomp log tightening
Lennart Poettering [Wed, 26 Sep 2018 13:37:22 +0000 (15:37 +0200)]
Merge pull request #10168 from keszybz/coverity-fixes
Coverity fixes
Patrik Flykt [Wed, 26 Sep 2018 00:09:17 +0000 (18:09 -0600)]
networkd-dhcp6: Set initial value of route to NULL
Start with route set to NULL should there be no route created. Remove
the explicit route_free as the _cleanup_ will take care of that after
the continue;.
Yu Watanabe [Tue, 25 Sep 2018 11:58:24 +0000 (20:58 +0900)]
libsystemd: add missing 'global' specifier in libsystemd.sym
William Douglas [Mon, 10 Sep 2018 19:07:29 +0000 (12:07 -0700)]
RFC tmpfiles: Allow configuration to ignore execution errors
This is an implementation that covers making errors encountered when writing
file content optionally fatal. If this is something that folks would want I'll
add handling of this for all the other directives. I'd appreciate suggestions
on how this might better be structured as well (use of a goto fail or such) as
I'm not super happy with the approach.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 17:50:49 +0000 (19:50 +0200)]
Merge pull request #10169 from poettering/putenv-error-handling
add missing putenv() error handling
Lennart Poettering [Mon, 25 Jun 2018 17:17:42 +0000 (19:17 +0200)]
utf8: add utf8_to_utf16() helper
Lennart Poettering [Mon, 25 Jun 2018 17:16:43 +0000 (19:16 +0200)]
utf8: let's update utf16_to_utf8() a bit
Let's change utf16_to_utf8() prototype to refer to utf16 chars with char16_t rather than void
Let's not cast away a "const" needlessly.
Let's add a few comments.
Let's fix the calculations of the buffer size to allocate, and how long
to run the loop in case of uneven byte numbers
Lennart Poettering [Wed, 18 Jul 2018 10:30:00 +0000 (12:30 +0200)]
utf8: change return type of utf8_encoded_expected_len() to size_t
After all it returns a lengths of a string in chars, and hence should
return size_t, exactly like strlen().
Lennart Poettering [Wed, 18 Jul 2018 10:23:31 +0000 (12:23 +0200)]
utf8: modernize utf16 inline calls a bit
Let's fix an indentation issue.
Let's avoid yoda comparisons.
Let's drop unnecessary ().
Let's make sure we convert 16bit values to 32bit before shifting them by
10bit to the left, to avoid overflows.
Let's avoid comparisons between signed literals and unsigned variables,
in particular if the literals are outside of the minimum range C
requires for "int".
Lennart Poettering [Wed, 18 Jul 2018 10:21:39 +0000 (12:21 +0200)]
utf8: update utf8_is_valid() a bit
Let's avoid a few casts in the function. Also, let's drop the "const"
when returning the string, for similar reasons as strchr() and friends
drop it: so that we don't add a const if the user passes in a non-const
string.
Lennart Poettering [Tue, 25 Sep 2018 10:35:36 +0000 (12:35 +0200)]
Merge pull request #10088 from keszybz/man-systemctl-return
man: add a description of systemctl return codes
Lennart Poettering [Tue, 25 Sep 2018 10:34:30 +0000 (12:34 +0200)]
Merge pull request #10059 from yuwata/env-exec-directory
core: introduce $RUNTIME_DIRECTORY= or friends
Lennart Poettering [Tue, 25 Sep 2018 10:03:06 +0000 (12:03 +0200)]
exec-util: add missing logging call
This function logs about all errors, but one case was forgotten. Fix
that.
Lennart Poettering [Tue, 25 Sep 2018 10:02:26 +0000 (12:02 +0200)]
exec-util: handle putenv() errors
Just paranoia, as putenv() can fail and we should catch it, like we
catch all other errors.
Follow-up for #10073
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:34:52 +0000 (11:34 +0200)]
test-journal-syslog: initialize variable
The *priority argument to syslog_parse_priority() needs to be initialized
if the last argument (with_facility) is false.
CID #1394690.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:29:54 +0000 (11:29 +0200)]
udev-builtin-net_id: do not assume "type" attribute exists
It *should*, but who knows, let's be more defensive here.
CID #1395805.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:22:13 +0000 (11:22 +0200)]
journal-upload: fix off-by-one in assert()
CID #1394386.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:15:27 +0000 (11:15 +0200)]
sd-event: use new cleanup function more
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:10:12 +0000 (11:10 +0200)]
sd-event: remove dead code and use _cleanup_
CID #1393250.
Lennart Poettering [Mon, 24 Sep 2018 17:01:37 +0000 (19:01 +0200)]
docs: clarify controller mount logic in hybrid cgroups mode
Fixes: #10107
Thiago Macieira [Mon, 24 Sep 2018 20:03:02 +0000 (13:03 -0700)]
Make bzip2 an optional dependency for systemd-importd
Yes, there are still a lot of users of bzip2, but it's fallen out of
favour after LZMA/xz, which can compress a lot more and often
decompresses faster than bzip2 too.
Lennart Poettering [Tue, 25 Sep 2018 08:24:30 +0000 (10:24 +0200)]
Merge pull request #10163 from poettering/inhibit-format-table
systemd-inhibit --list: port to format-table.c
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 08:07:23 +0000 (10:07 +0200)]
Merge pull request #10073 from xnox/execve
Execute generators with manager's environment exported
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 07:29:36 +0000 (09:29 +0200)]
DHCPv6: use unsigned for flags
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 07:24:14 +0000 (09:24 +0200)]
Merge pull request #10164 from poettering/btrfs-resize-fix
btrfs resize fix
Lennart Poettering [Mon, 24 Sep 2018 16:59:54 +0000 (18:59 +0200)]
udev: fix some type sloppiness
We use strtoul() which returns an "unsigned long", but then assign this
to int or unsigned in, i.e. drop 32bit silently on 64bit systems. Let's
clean this up a bit, and retain the right types.
Lennart Poettering [Mon, 24 Sep 2018 22:02:41 +0000 (01:02 +0300)]
logind: fix blacklist/whitelist confusion in comment (#10165)
Triggered by this:
https://github.com/systemd/systemd/commit/
602a41c22ac2df33b4b5e5083719c1cfaf58acf9#r30575293
Lennart Poettering [Mon, 24 Sep 2018 21:25:48 +0000 (00:25 +0300)]
docs: fix CONTRIBUTING path (#10160)
Lennart Poettering [Mon, 24 Sep 2018 17:47:42 +0000 (19:47 +0200)]
btrfs: log at debug log when we ignore errors
This stuff is likely to fail in many setups (for example when quota is
not supported by the btrfs version), hence only log at debug
level. Previously we'd silently ignore things altogether which makes
things pretty hard to debug.
Lennart Poettering [Mon, 24 Sep 2018 17:44:06 +0000 (19:44 +0200)]
btrfs: fix loopback resizing code
This corrects the block device to use, to the right path, as it was
before
553e15f21bd7b1ecb709edfb5686d5768fe942f2.
Replaces: #10153
Lennart Poettering [Mon, 24 Sep 2018 17:01:08 +0000 (19:01 +0200)]
update TODO
Lennart Poettering [Wed, 19 Sep 2018 18:21:45 +0000 (21:21 +0300)]
inhibit: use format-table to format systemd-inhibit --list
This changes the output a bit, as the previous multi-line output of each
inhibitor is changed to a single line, but it does unify the output look
with the one of our other tools. Moreover this adds proper sorting.
Lennart Poettering [Wed, 19 Sep 2018 17:57:42 +0000 (20:57 +0300)]
inhibit: normalize variable types
When we parse an "u" from an sd_bus_message then we need to do that into
a uint32_t, not a pid_t or uid_t, even if this is likely the same.
Also, let's count objects we keep in memory as size_t as usual.
Lennart Poettering [Wed, 19 Sep 2018 17:53:22 +0000 (20:53 +0300)]
inhibit: normalize when we log about failures to list inhibitors
let's print log messages about all types of errors inside of the
function, since otherwise we might sometimes log twice about some
specific cases.
Yu Watanabe [Sun, 23 Sep 2018 07:17:03 +0000 (16:17 +0900)]
fs-util: make symlink_idempotent() optionally create relative link
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 15:27:49 +0000 (17:27 +0200)]
Merge pull request #9989 from yuwata/sd-device-enoent
sd-device: make sd_device_get_*() return -ENOENT if the values are not set
Zbigniew Jędrzejewski-Szmek [Thu, 20 Sep 2018 12:19:41 +0000 (14:19 +0200)]
seccomp: tighten checking of seccomp filter creation
In seccomp code, the code is changed to propagate errors which are about
anything other than unknown/unimplemented syscalls. I *think* such errors
should not happen in normal usage, but so far we would summarilly ignore all
errors, so that part is uncertain. If it turns out that other errors occur and
should be ignored, this should be added later.
In nspawn, we would count the number of added filters, but didn't use this for
anything. Drop that part.
The comments suggested that seccomp_add_syscall_filter_item() returned negative
if the syscall is unknown, but this wasn't true: it returns 0.
The error at this point can only be if the syscall was known but couldn't be
added. If the error comes from our internal whitelist in nspawn, treat this as
error, because it means that our internal table is wrong. If the error comes
from user arguments, warn and ignore. (If some syscall is not known at current
architecture, it is still silently ignored.)
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 14:59:12 +0000 (16:59 +0200)]
seccomp: reduce logging about failure to add syscall to seccomp
Our logs are full of:
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldstat() / -10037, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call get_thread_area() / -10076, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call set_thread_area() / -10079, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldfstat() / -10034, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldolduname() / -10036, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldlstat() / -10035, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call waitpid() / -10073, ignoring: Numerical argument out of domain
...
This is pointless and makes debug logs hard to read. Let's keep the logs
in test code, but disable it in nspawn and pid1. This is done through a function
parameter because those functions operate recursively and it's not possible to
make the caller to log meaningfully.
There should be no functional change, except the skipped debug logs.
Zbigniew Jędrzejewski-Szmek [Fri, 21 Sep 2018 12:14:45 +0000 (14:14 +0200)]
test-seccomp: log function names
Various tests produce similar output, and the function names make it
easier to see where the output is generated.
Zbigniew Jędrzejewski-Szmek [Fri, 21 Sep 2018 12:12:04 +0000 (14:12 +0200)]
test-seccomp: move two similar tests closer
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 13:15:23 +0000 (15:15 +0200)]
Merge pull request #10087 from keszybz/xnox/fix-test-functions
test/test-functions: drop all prefixes
Dimitri John Ledkov [Wed, 12 Sep 2018 18:52:30 +0000 (19:52 +0100)]
core: execute generators with manager's environmnet
Dimitri John Ledkov [Wed, 12 Sep 2018 18:51:23 +0000 (19:51 +0100)]
core: execute environment_generators with manager's environment
Dimitri John Ledkov [Wed, 12 Sep 2018 17:19:13 +0000 (18:19 +0100)]
exec-util: in execute_directories, support initial exec environment
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 11:14:06 +0000 (13:14 +0200)]
Merge pull request #10082 from porrided/udev-ipoib
Introduce predictable naming for IP-over-InfiniBand NICs
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 11:02:24 +0000 (13:02 +0200)]
Merge pull request #9981 from pfl/dhcp6_pd_other_information_quirk
DHCPv6 PD other information quirk
Yu Watanabe [Sat, 1 Sep 2018 14:13:54 +0000 (23:13 +0900)]
tree-wide: drop unnecessary initializations
Yu Watanabe [Sat, 1 Sep 2018 14:12:47 +0000 (23:12 +0900)]
tree-wide: do not assign unused return values
Yu Watanabe [Sat, 1 Sep 2018 14:09:54 +0000 (23:09 +0900)]
logind-acl: replace strdup()+set_consume() by set_put_strdup()
Yu Watanabe [Sat, 1 Sep 2018 14:07:18 +0000 (23:07 +0900)]
gpt-auto-generator: do not assign '*ret' on error
Yu Watanabe [Sat, 1 Sep 2018 14:03:22 +0000 (23:03 +0900)]
tree-wide: use streq() instead of streq_ptr()
Yu Watanabe [Sat, 1 Sep 2018 09:05:27 +0000 (18:05 +0900)]
sd-device: make sd_device_get_*() return -ENOENT if the values are not set
Yu Watanabe [Fri, 21 Sep 2018 08:10:34 +0000 (17:10 +0900)]
test-udev: use LOG_REALM_UDEV
Otherwise, even if SYSTEMD_LOG_LEVEL=debug is specified, the test does
not show most debug messages.
Yu Watanabe [Fri, 21 Sep 2018 08:45:26 +0000 (17:45 +0900)]
udevadm: show only version number for '--version' option
This effectively reverts
2bc54be485def3d1697a00209ff73ae21aa7f268
and relevant changes in #9920, as it is used to determine the version
of udev, e.g., dracut.
Fixes dracutdevs/dracut#468.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Sep 2018 21:07:48 +0000 (23:07 +0200)]
Merge pull request #10135 from yuwata/log-skipped-tests
test: add log messages when some tests are skipped
Yu Watanabe [Fri, 14 Sep 2018 06:55:15 +0000 (15:55 +0900)]
test-seccomp: add log messages when skipping tests
Yu Watanabe [Thu, 20 Sep 2018 07:09:05 +0000 (16:09 +0900)]
test-process-util: logs something when skipping tests
Yu Watanabe [Thu, 20 Sep 2018 07:38:19 +0000 (16:38 +0900)]
sd-hwdb: initialize variable
The variable 'fn' was not initialized on compat mode.
Fixes CID#1395731.
João Paulo Rechi Vita [Tue, 18 Sep 2018 22:03:54 +0000 (15:03 -0700)]
tmpfiles: Order tmpfiles-setup after journald
systemd-tmpfiles-setup.service needs to be ordered after
systemd-journald.service, so entries in /run/log/journal are already
created when systemd-tmpfiles tries to adjust its permissions.
This is specially problematic for setups using a volatile journal where
the initrd does not ship a machine-id (i.e. OSTree-based systems), where
logs from the initrd will be inaccessible for users in the
systemd-journal group. It also has a side effect of `journalctl --user`
failing with "No journal files were opened due to insufficient
permissions".
Fixes #10128.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Sep 2018 07:01:58 +0000 (09:01 +0200)]
meson: fix dirname/basename confusion in meson-and-wants.sh install helper (#10126)
We would create a useless empty directory under build/.
It seems we were lucky and all symlinks were installed into directories
which were alredy created because we installed something into the same
location earlier.
While at it, also add '-v' to 'mkdir -p'. This will print the names of
directories as they are created (just once), making it easier to see all of
what the install script is doing.
Patrik Flykt [Wed, 19 Sep 2018 00:32:30 +0000 (18:32 -0600)]
networkd-manager: Fix route removals on shutdown
In order to shut down networkd properly, the delegated routes added
need to be removed properly, and as error reporting is wanted, the
network link is needed in the debug output.
Solve this by calling manager_dhcp6_prefix_remove_all(), which will
remove each prefix stored in the Manager structure, and while doing
that reference each link so that it isn't freed before the route
removal callback is called. This in turn causes the network link to
be referenced once more, and an explicit hashmap_remove() must be
called to remove the network link from the m->links hashmap.
Also, since the registered callback is not called when the DHCPv6
client is stopped with sd_dhcp6_client_stop(), an explicit call
to dhcp6_lease_pd_prefix_lost() needs to be made to clean up any
unreachable routes set up for the delegated prefixes.
Patrik Flykt [Wed, 19 Sep 2018 00:32:28 +0000 (18:32 -0600)]
networkd-manager: Update logging of route additions and removals
Log route additions and removals when the action is to be done, as
the reply rtnl message may contain only a success or failure.
Patrik Flykt [Wed, 19 Sep 2018 00:32:26 +0000 (18:32 -0600)]
sd-dhcp6-client: Reference and unreference a stored lease
In order to be able to properly free a DHCPv6 lease, unreference the
previous lease and reference the new one.
Patrik Flykt [Wed, 19 Sep 2018 00:32:23 +0000 (18:32 -0600)]
networkd-dhcp6: Remove functions whose output is not used
Remove dhcp6_reset_pd_prefix_network() that returns the network, but
whose output is not used anywhere.
Patrik Flykt [Wed, 19 Sep 2018 00:32:19 +0000 (18:32 -0600)]
networkd-dhcp6: Set one unreachable route per DHCPv6 delegated prefix
Instead of setting many small unreachable routes for each of the /64
subnets that were not distributed between the links requesting delegated
prefixes, set one unreachable route for the size of the delegated
prefix. Each subnet asssigned to a downstream link will add a routable
subnet for that link, and as the subnet assigned to the downstream link
has a longer prefix than the whole delegated prefix, the downstream
link subnet routes are preferred over the unroutable delegated one.
The unreachable route is not added when the delegated prefix is exactly
a /64 as the prefix size cannot be used to sort out the order of routing
into a bigger blocking subnet with the smaller /64 punching routable
"holes" into it.
When stopping the DHCPv6 client, the unroutable delegated prefix is
removed before the downstream link prefixes are unassigned.
Patrik Flykt [Tue, 11 Sep 2018 22:26:01 +0000 (16:26 -0600)]
dhcp6-client: Store lease timeouts T1 and T1 in client struct
Since we now have the possibility to request prefixes to be delegated
without corresponding IPv6 addresses, it does not make sense to store
lease T1 and T2 timeouts in the otherwise unused IA_NA structure.
Therefore lease timeouts T1 and T2 are moved to the DHCPv6 client
structure, as there will be only one set of stateful timeouts required
by RFC 7550, Section 4.3.
Patrik Flykt [Tue, 11 Sep 2018 17:55:38 +0000 (11:55 -0600)]
dhcp6-client: Select T1 and T2 timeouts from IA_NA and IA_PD
Select T1 and T2 timeouts based on whether addresses or prefixes were
requested and what the server offered. The address and prefix timeouts
values have been computed earlier when the relevant DHCPv6 options were
parsed.
Patrik Flykt [Fri, 7 Sep 2018 20:37:56 +0000 (14:37 -0600)]
dhcp6-lease: Add function to fetch the IAID for the prefix
Add function to fetch the IAID for the delegated IA_PD prefix. In
order to keep things simple in the implemntation, the same IAID
is used with IA_NA addresses and IA_PD prefixes. But the DHCPv6
server can choose to return only IA_PD prefixes, and the client
can nowadays omit requesting of IA_NA addresses. Since the function
fetching said IAID from the lease looks only for IA_NA ones, it
will return an empty IAID, which of course does not match the one
set for prefixes.
Fix this by adding a function returning the IAID for the prefix.
Patrik Flykt [Fri, 7 Sep 2018 20:15:55 +0000 (14:15 -0600)]
networkd-network: Introduce DHCPv6 PD knob for RFC 7084 WPD-4
RFC 7084, WPD-4, requires Customer Edge end routers to behave
according to the following:
"WPD-4: By default, the IPv6 CE router MUST initiate DHCPv6 prefix
delegation when either the M or O flags are set to 1 in a
received Router Advertisement (RA) message. Behavior of the
CE router to use DHCPv6 prefix delegation when the CE router
has not received any RA or received an RA with the M and the
O bits set to zero is out of scope for this document."
Since it cannot be automatically detected whether DHCPv6 is to be
operated as an CE end router or whether to initiate an Informational
exchange to obtain other useful network information via DHCPv6 when the
Router Advertisement 'O' bit is set, a 'ForceDHCPv6PDOtherInformation'
boolean network configuration option in the '[DHCP]' section of a is
introduced. Setting this option causes DHCPv6 to be started in stateful
mode, although only the 'O' bit is seen in the Router Advertisement.
When 'ForceDHCPv6PDOtherInformation' is set and the Router Advertisement
has only the Other information 'O' bit set, disable requests for IA_NA
addresses.
Fixes #9745.
Patrik Flykt [Fri, 7 Sep 2018 15:24:15 +0000 (09:24 -0600)]
dhcp6-client: Add tests for address, information and prefix requests
Add simple test cases to ensure the request for addresses, prefixes
and information request are handled as expected.
Patrik Flykt [Fri, 7 Sep 2018 20:00:10 +0000 (14:00 -0600)]
dhcp6-client: Function for enabling/disabling IA_NA request
Add function to enable/disable IA_NA address requests. Internally
handle the request as a bit mask and add IA_PD prefix delegation
to the same bit mask instead of having a separate boolean. Thus
the calling code can set requests for prefix and address delegation
separately. This is handy when supporting RFC 7084.
Add a check in the code that at least something is requested from
the server in Managed mode. By default request IA_NA addresses from
the DHCPv6 server. Although a value has been defined for IA_TA,
temporay IA_TA addresses are not yet requested.
Patrik Flykt [Thu, 6 Sep 2018 17:31:48 +0000 (11:31 -0600)]
dhcp6_client: Add helper for fetching Prefix Delegation information
Add helper function for fetching enabled/disabled state of Prefix
Delegation for a DHCPv6 client. Update function setting prefix
delegation to use an int instead of a boolean.
Zbigniew Jędrzejewski-Szmek [Wed, 19 Sep 2018 11:34:01 +0000 (13:34 +0200)]
Merge pull request #10113 from yuwata/unify-hwdb
hwdb,udevadm: unify duplicated code and move it to hwdb-util.c
Yu Watanabe [Tue, 18 Sep 2018 14:14:18 +0000 (23:14 +0900)]
hwdb,udevadm: also unify hwdb_query() and hwdb_test()
Yu Watanabe [Tue, 18 Sep 2018 14:09:43 +0000 (23:09 +0900)]
sd-hwdb: use structured initializers
Yu Watanabe [Tue, 18 Sep 2018 13:57:45 +0000 (22:57 +0900)]
hwdb: unify duplicated code and move it to hwdb-util.c
Both 'systemd-hwdb update' and 'udevadm hwdb --update' creates hwdb
database. The database created by systemd-hwdb containes additional
information such that priority, line number, and source filename.
The unified function 'hwdb_update()' can take a flag 'compat' which
controls the format version of created database.
Yu Watanabe [Tue, 18 Sep 2018 04:37:51 +0000 (13:37 +0900)]
sd-hwdb: adjust included headers
Yu Watanabe [Tue, 18 Sep 2018 03:50:33 +0000 (12:50 +0900)]
hwdb: use _cleanup_ attribute at one more place
Yu Watanabe [Tue, 18 Sep 2018 03:49:51 +0000 (12:49 +0900)]
hwdb: make trie_node_cleanup() can take NULL
javitoom [Wed, 19 Sep 2018 07:29:25 +0000 (09:29 +0200)]
Remove trailing space
Remove trailing space
javitoom [Mon, 17 Sep 2018 14:48:41 +0000 (16:48 +0200)]
hwdb: Add accelerometer orientation quirk for the Teclast X98 Plus I (A5C6) tablet
Add accelerometer orientation quirk for the Teclast X98 Plus I (A5C6) tablet.