Lennart Poettering [Fri, 3 Jun 2016 17:20:46 +0000 (19:20 +0200)]
networkd: drop weird "const" usage in function parameters
We generally only use "const" to constify the destination of pointers, but not
the pointers themselves, as they are copied anyway during C function
invocation. Hence, drop this usage of "const".
Lennart Poettering [Fri, 3 Jun 2016 17:20:00 +0000 (19:20 +0200)]
sd-netlink: fix sd_netlink_inc_rcvbuf() prototype
Drop weird "const" usage, and use size_t for sizes.
Lennart Poettering [Fri, 3 Jun 2016 17:14:12 +0000 (19:14 +0200)]
networkd: enforce a limit on the number of statically assigned addresses/routes/fdb entries
We should put a limit on everything, hence also on these resources.
Topi Miettinen [Fri, 3 Jun 2016 15:58:18 +0000 (15:58 +0000)]
core: Restrict mmap and mprotect with PAGE_WRITE|PAGE_EXEC (#3319) (#3379)
New exec boolean MemoryDenyWriteExecute, when set, installs
a seccomp filter to reject mmap(2) with PAGE_WRITE|PAGE_EXEC
and mprotect(2) with PAGE_EXEC.
Lennart Poettering [Fri, 3 Jun 2016 15:57:04 +0000 (17:57 +0200)]
Merge pull request #3409 from tomty89/update-2
networkd-dhcp6: DHCPv6 starting fixes
Lennart Poettering [Fri, 3 Jun 2016 15:49:50 +0000 (17:49 +0200)]
Merge pull request #3418 from htejun/cgroup2-log-compat
core: log cgroup legacy and unified hierarchy setting translations
Tejun Heo [Fri, 3 Jun 2016 15:49:05 +0000 (08:49 -0700)]
core: always use "infinity" for no upper limit instead of "max" (#3417)
Recently added cgroup unified hierarchy support uses "max" in configurations
for no upper limit. While consistent with what the kernel uses for no upper
limit, it is inconsistent with what systemd uses for other controllers such as
memory or pids. There's no point in introducing another term. Update cgroup
unified hierarchy support so that "infinity" is the only term that systemd
uses for no upper limit.
Tobias Jungel [Fri, 3 Jun 2016 10:33:12 +0000 (12:33 +0200)]
missing include added for build with -DDEBUG (#3424)
Evgeny Vereshchagin [Fri, 3 Jun 2016 09:17:00 +0000 (12:17 +0300)]
tests: introduce UNIFIED_CGROUP_HIERARCHY (#3419)
There are many cgroups-related changes (thanks, @htejun!)
This commit will simplify testing a bit.
Use:
make run UNIFIED_CGROUP_HIERARCHY=yes to enable cgroup-v2
make run UNIFIED_CGROUP_HIERARCHY=no to enable cgroup-v1
Martin Pitt [Fri, 3 Jun 2016 09:15:44 +0000 (11:15 +0200)]
resolved: fix comments in resolve.conf for search domain overflows (#3422)
Write comments about "too many search domains" and "Total length of all search
domains is too long" just once. Also put it on a separate line, as
resolv.conf(5) only specifies comments in a line by themselves.
This is ugly to do if write_resolv_conf_search() gets called once for every
search domain. So change it to receive the complete OrderedSet instead and do
the iteration by itself.
Add test cases to networkd-test.py.
https://launchpad.net/bugs/1588229
Matthieu Codron [Fri, 3 Jun 2016 07:41:14 +0000 (09:41 +0200)]
hwdb: Add Thinkpad X1 carbon 4th gen to 70-pointingstick.hwdb (#3426)
Like many other recent thinkpads the factory default pointingstick
sensitivity on these devices is quite low, making the pointingstick
very slow in moving the cursor.
This extends the existing hwdb rules for tweaking the sensitivity to
also apply to the X1 carbon 4thgen model.
Tejun Heo [Thu, 2 Jun 2016 17:02:53 +0000 (13:02 -0400)]
core: log cgroup legacy and unified hierarchy setting translations
To accommodate changes in kernel interface, cgroup unified hierarchy support
added several configuration items which overlap with the existing resource
control settings and there is simple config translation between the overlapping
settings to ease the transition. As why certain cgroup knobs are being
configured can become confusing, this patch adds a master warning message which
is printed once when such translation is first used and logs each translation
with a debug message.
v2:
- Switched to log_unit*().
Tejun Heo [Thu, 2 Jun 2016 17:02:49 +0000 (13:02 -0400)]
core: pass Unit into cgroup_context_apply() and use log_unit*()
cgroup_context_apply() and friends take CGroupContext and cgroup path as input
and has no way of getting back to the associated Unit and thus uses raw cgroup
path for logging. This makes the log messages difficult to track down.
There's no reason to avoid passing in Unit into these functions. Pass in Unit
and use log_unit*() instead.
While at it, make cgroup_context_apply(), which has no outside users, static.
Also, drop cgroup path from log messages where the path itself isn't too
interesting and can be easily obtained from the unit.
Tom Yan [Wed, 1 Jun 2016 17:05:50 +0000 (01:05 +0800)]
networkd-ndisc: do not start DHCPv6 when after NDISC timeout
For it's silly and unnecessary. Although it was apparently mandated by RFC 2462 in [5.5.2. Absence of Router Advertisements], that has been changed in the same section of RFC 4862, which obsoleted the former RFC.
Topi Miettinen [Wed, 1 Jun 2016 09:56:01 +0000 (09:56 +0000)]
core: add pre-defined syscall groups to SystemCallFilter= (#3053) (#3157)
Implement sets of system calls to help constructing system call
filters. A set starts with '@' to distinguish from a system call.
Closes: #3053, #3157
Franck Bui [Wed, 1 Jun 2016 09:52:35 +0000 (11:52 +0200)]
units: wait for plymouth to shut down in rescue.sevice (#3367)
In the same vein as commit
ac59f0c12c117b9bb5b7e17f33987b0107791239 which added
the --wait option to the emergency service, this patch makes sure that plymouth
has exited before entering into the rescue mode.
Tom Yan [Wed, 1 Jun 2016 06:54:46 +0000 (14:54 +0800)]
networkd-dhcp6: generalize DHCPv6 client (re)starting
dhcp6_request_address() was merely a function to switch the DHCPv6 client from "stateless" mode to "stateful" mode. It was also a one-way switch. Also, to (re)start the client, we would need to repeat separate function calls.
In this patch, dhcp6_request_address() is made a general starter/manager of the DHCPv6 client. It now takes an extra parameter so we will be specifying which mode the DHCPv6 client should be started in. Also it will keep track of the current mode and compare with the newly requested mode, and only restart the client in case there is a difference between them.
This also makes sure that the DHCPv6 client will be (re)started accordingly as per the Router Advertisement flags.
Susant Sahani [Tue, 31 May 2016 16:20:25 +0000 (21:50 +0530)]
systemctl: systemctl show --property' needs verification of property (#3364)
systemctl --property doesn't validate if a requested property is valid or not,
and always returns with an exit code of 0, regardless of whether the requested
property exists or not.
How reproducible:
This works fine:
Id=multi-user.target
But put in a non-existing property:
Id=default.targets.service
Id=default.targets.service
0
[root@shou18lkvm8 ~]# systemctl show --property Id this.is.rubbish; echo $?
Id=this.is.rubbish.service
0
After:
sus@maximus bz-95593]$ ./systemctl show --property Id this.is.rubbish; echo $?
Can't display property this.is.rubbish. Unit this.is.rubbish.service does not
exist.
4
fixes #2295
Susant Sahani [Tue, 31 May 2016 13:36:58 +0000 (19:06 +0530)]
systemctl: Replace init script error codes with enum (#3400)
Now we just using constants for the init script exit status codes.
Replace those error codes with enum so that it's more meaningful
and readable.
Thomas Haller [Tue, 31 May 2016 11:00:54 +0000 (13:00 +0200)]
network: fix wrong include of source file "ether-addr-util.c" (#3402)
Fixes:
9ed8b06c9be4a5efae432d5cf4b1c47d03e6f107
Peter Hutterer [Tue, 31 May 2016 09:00:05 +0000 (19:00 +1000)]
hwdb: add axis ranges for the Lenovo X220 touchpad (#3397)
Side-effect of https://bugs.freedesktop.org/show_bug.cgi?id=94989
Lennart Poettering [Mon, 30 May 2016 23:49:57 +0000 (01:49 +0200)]
man: document that systemctl -ff reboot does not require PID 1 to work (#3310)
As suggested in
https://github.com/systemd/systemd/issues/3282#issuecomment-
220264509
Tobias Jungel [Mon, 30 May 2016 15:00:16 +0000 (17:00 +0200)]
networkd: bridge add support to configure VLAN filtering (#3344)
This patch implements support for IFLA_BR_VLAN_FILTERING configuration.
Susant Sahani [Mon, 30 May 2016 14:53:15 +0000 (20:23 +0530)]
systemctl: return diffrent error code if service exist or not (#3385)
Before:
[sus@maximus bz-1256858]$ systemctl status rsyslog.service;echo $?
● rsyslog.service - System Logging Service
Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor
preset: enabled)
Drop-In: /etc/systemd/system/rsyslog.service.d
└─50-CPUShares.conf
Active: inactive (dead) since Mon 2016-05-30 11:54:25 IST; 2h 26min ago
Docs: man:rsyslogd(8)
http://www.rsyslog.com/doc/
Process: 1159 ExecStart=/usr/sbin/rsyslogd -n $SYSLOGD_OPTIONS (code=exited,
status=0/SUCCESS)
Main PID: 1159 (code=exited, status=0/SUCCESS)
May 30 11:07:50 maximus systemd[1]: Starting System Logging Service...
May 30 11:07:50 maximus systemd[1]: Started System Logging Service.
May 30 11:54:25 maximus systemd[1]: Stopping System Logging Service...
May 30 11:54:25 maximus systemd[1]: Stopped System Logging Service.
3
[sus@maximus bz-1256858]$ systemctl status hello.service;echo $?
● hello.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
3
After:
$ ./systemctl status hello.service;echo $?
Failed to dump process list, ignoring: Access denied
● hello.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
4
[sus@maximus bz-1256858]$ ./systemctl status rsyslog.service;echo $?
Failed to dump process list, ignoring: Access denied
● rsyslog.service - System Logging Service
Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor
preset: enabled)
Drop-In: /etc/systemd/system/rsyslog.service.d
└─50-CPUShares.conf
Active: inactive (dead) since Mon 2016-05-30 11:54:25 IST; 2h 24min ago
Docs: man:rsyslogd(8)
http://www.rsyslog.com/doc/
Process: 1159 ExecStart=/usr/sbin/rsyslogd -n $SYSLOGD_OPTIONS (code=exited,
status=0/SUCCESS)
Main PID: 1159 (code=exited, status=0/SUCCESS)
May 30 11:07:50 maximus systemd[1]: Starting System Logging Service...
May 30 11:07:50 maximus systemd[1]: Started System Logging Service.
May 30 11:54:25 maximus systemd[1]: Stopping System Logging Service...
May 30 11:54:25 maximus systemd[1]: Stopped System Logging Service.
3
Fixes: 1092
Alessandro Puccetti [Mon, 30 May 2016 14:37:07 +0000 (16:37 +0200)]
doc: clarify systemd.exec's paths definition (#3368)
Definitions of ReadWriteDirectories=, ReadOnlyDirectories=, InaccessibleDirectories=,
WorkingDirectory=, and RootDirecory= were not clear. This patch specifies when
they are relative to the host's root directory and when they are relative to the service's
root directory.
Fixes #3248
Franck Bui [Mon, 30 May 2016 14:35:34 +0000 (16:35 +0200)]
udevd: try close ctrl connection blocking socket only once when spawning a new worker (#3387)
Ronny Chevalier [Mon, 30 May 2016 11:57:38 +0000 (12:57 +0100)]
Merge pull request #3389 from lucab/to-upstream/man-typos
man: fix recurring typo
Luca Bruno [Mon, 30 May 2016 11:43:53 +0000 (13:43 +0200)]
man: fix recurring typo
Michael Karcher [Mon, 30 May 2016 00:03:51 +0000 (02:03 +0200)]
util-lib: Add sparc64 support for process creation (#3348)
The current raw_clone function takes two arguments, the cloning flags and
a pointer to the stack for the cloned child. The raw cloning without
passing a "thread main" function does not make sense if a new stack is
specified, as it returns in both the parent and the child, which will fail
in the child as the stack is virgin. All uses of raw_clone indeed pass NULL
for the stack pointer which indicates that both processes should share the
stack address (so you better don't pass CLONE_VM).
This commit refactors the code to not require the caller to pass the stack
address, as NULL is the only sensible option. It also adds the magic code
needed to make raw_clone work on sparc64, which does not return 0 in %o0
for the child, but indicates the child process by setting %o1 to non-zero.
This refactoring is not plain aesthetic, because non-NULL stack addresses
need to get mangled before being passed to the clone syscall (you have to
apply STACK_BIAS), whereas NULL must not be mangled. Implementing the
conditional mangling of the stack address would needlessly complicate the
code.
raw_clone is moved to a separete header, because the burden of including
the assert machinery and sched.h shouldn't be applied to every user of
missing_syscalls.h
Lennart Poettering [Sun, 29 May 2016 16:42:40 +0000 (18:42 +0200)]
Merge pull request #3378 from keszybz/unit-write-drop-in-newline-removal
Remove newlines from drop in format strings + some formatting fixes
kpengboy [Sun, 29 May 2016 15:31:14 +0000 (08:31 -0700)]
Fix FS_EXTENT_FL description (#3381)
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 20:49:43 +0000 (16:49 -0400)]
man: cite systemd.offline-updates(7) instead of linking to old wiki page
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 20:43:22 +0000 (16:43 -0400)]
man: punctuation fixes
Fixes #3376.
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 20:21:47 +0000 (16:21 -0400)]
tree-wide: remove newlines from unit_write_drop_in
This reverts part of #3329, but all for a good cause.
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 20:06:44 +0000 (16:06 -0400)]
core/unit: append newline when writing drop ins
unit_write_drop_in{,_private}{,_format} are all affected.
We already append a header to the file (and section markers), so those functions
can only be used to write a whole file at once. Including the newline at
the end feels natural.
After this commit newlines will be duplicated. They will be removed in
subsequent commit.
Also, rewrap the "autogenerated" header to fit within 80 columns.
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 19:28:51 +0000 (15:28 -0400)]
Merge pull request #3326 from tomty89/update-2
networkd: IPv6 fixes
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 19:02:05 +0000 (15:02 -0400)]
Merge pull request #3360 from glaubitz/master
Fix multiple unaligned accesses in test-dns-packet and sd-dhcp-server.
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 15:50:37 +0000 (11:50 -0400)]
Typo fix: s/advertisment/advertisement/
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 14:50:36 +0000 (10:50 -0400)]
systemctl: remove empty line between comment and action
It's harder to miss the comment without the newline ;)
See https://github.com/systemd/systemd/pull/3336#issuecomment-
221749423
for context.
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 15:48:37 +0000 (11:48 -0400)]
Merge pull request #3328 from poettering/ipv4ll-ipv4acd-fixes
various sd-Ipv4ll/sd-ipv4acd fixes
Zbigniew Jędrzejewski-Szmek [Sat, 28 May 2016 14:52:06 +0000 (10:52 -0400)]
Merge pull request #3336 from eworm-de/systemctl-set-default
systemctl: return success for set-default, add-wants, add-requires...
Michael Biebl [Sat, 28 May 2016 09:03:03 +0000 (11:03 +0200)]
login: Fix policy for org.freedesktop.login1.set-self-linger (#3365) (#3373)
We need to explicitly define authorizations for allow_inactive and
allow_active. Otherwise one is getting "Access denied" when run from a
local console:
$ loginctl enable-linger
Could not enable linger: Access denied
Tom Yan [Sat, 28 May 2016 05:35:01 +0000 (13:35 +0800)]
networkd: disable IPv6 for bridge slave
If an interface is managed as a bridge slave, we don't want any IP configuration for it. Therefore, disable IPv6 in such case.
Tom Yan [Sat, 28 May 2016 05:31:41 +0000 (13:31 +0800)]
networkd: unset master if not enslaved with networkd
When we manage an interface with networkd but not as a slave (i.e. no `Bridge=` or `Bond=` set in its .network), we do not want it to remain slaved.
John Paul Adrian Glaubitz [Thu, 26 May 2016 21:48:04 +0000 (23:48 +0200)]
networkd/sd-dhcp-server: Fix unaligned access in parse_request().
Tejun Heo [Fri, 27 May 2016 16:10:18 +0000 (09:10 -0700)]
core: add cgroup memory controller support on the unified hierarchy (#3315)
On the unified hierarchy, memory controller implements three control knobs -
low, high and max which enables more useable and versatile control over memory
usage. This patch implements support for the three control knobs.
* MemoryLow, MemoryHigh and MemoryMax are added for memory.low, memory.high and
memory.max, respectively.
* As all absolute limits on the unified hierarchy use "max" for no limit, make
memory limit parse functions accept "max" in addition to "infinity" and
document "max" for the new knobs.
* Implement compatibility translation between MemoryMax and MemoryLimit.
v2:
- Fixed missing else's in config_parse_memory_limit().
- Fixed missing newline when writing out drop-ins.
- Coding style updates to use "val > 0" instead of "val".
- Minor updates to documentation.
Lennart Poettering [Fri, 27 May 2016 16:06:18 +0000 (18:06 +0200)]
Merge pull request #3329 from htejun/dbus-cgroup-fixes
dbus-cgroup fixes
Tejun Heo [Fri, 27 May 2016 15:41:45 +0000 (08:41 -0700)]
core: fix missing newline when writing drop-in for WorkingDirectory (#3337)
Lennart Poettering [Fri, 27 May 2016 15:37:19 +0000 (17:37 +0200)]
Merge pull request #3356 from OpenDZ/tixxdz/nspawn-quick-v1
nspawn: filesystem uid patching fixes and other minor improvments
Christian Hesse [Fri, 27 May 2016 07:33:27 +0000 (09:33 +0200)]
systemctl: fix code path (and memory leak) on error
Christian Hesse [Fri, 27 May 2016 07:32:41 +0000 (09:32 +0200)]
systemctl: fix return values on success
Christian Hesse [Fri, 27 May 2016 07:21:02 +0000 (09:21 +0200)]
systemctl: remove extra comma
John Paul Adrian Glaubitz [Thu, 26 May 2016 21:32:25 +0000 (23:32 +0200)]
resolve/test-dns-packet: Fix unaligned access in test_packet_from_file().
Djalal Harouni [Thu, 26 May 2016 11:06:55 +0000 (13:06 +0200)]
nspawn: rename arg_retain to arg_caps_retain
The argument is about capabilities.
Djalal Harouni [Thu, 26 May 2016 20:42:29 +0000 (22:42 +0200)]
nspawn: split out seccomp call into nspawn-seccomp.[ch]
Split seccomp into nspawn-seccomp.[ch]. Currently there are no changes,
but this will make it easy in the future to share or use the seccomp logic
from systemd core.
Djalal Harouni [Thu, 26 May 2016 10:59:49 +0000 (12:59 +0200)]
nspawn: rename is_procfs_sysfs_or_suchlike() to is_fs_fully_userns_compatible()
Rename is_procfs_sysfs_or_suchlike() to is_fs_fully_userns_compatible()
to give it the real meaning. This may prevent future modifications that
may introduce bugs.
Djalal Harouni [Thu, 26 May 2016 20:38:25 +0000 (22:38 +0200)]
nspawn: a bench of special fileystems that should not be shifted
Add some special filesystems that should not be shifted, most of them
relate to the host and not to containers.
Christian Hesse [Thu, 26 May 2016 13:57:37 +0000 (15:57 +0200)]
{machine,system}ctl: always pass &changes and &n_changes (#3350)
We have to pass addresses of changes and n_changes to
bus_deserialize_and_dump_unit_file_changes(). Otherwise we are hit by
missing information (subsequent calls to unit_file_changes_add() to
not add anything).
Also prevent null pointer dereference in
bus_deserialize_and_dump_unit_file_changes() by asserting.
Fixes #3339
Lennart Poettering [Thu, 26 May 2016 13:32:23 +0000 (15:32 +0200)]
ipv4ll: shorten some checks by using IN_SET a bit
As suggested:
https://github.com/systemd/systemd/pull/3328#discussion-diff-
64285764
Lennart Poettering [Tue, 24 May 2016 19:34:48 +0000 (21:34 +0200)]
sd-ndisc: small coding style fixes
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.
Lennart Poettering [Tue, 24 May 2016 19:34:25 +0000 (21:34 +0200)]
sd-ndisc: add more whitespace
Whitespace doesn't hurt and helps structuring things.
Lennart Poettering [Tue, 24 May 2016 19:32:33 +0000 (21:32 +0200)]
sd-ndisc: stop discovery properly when something fails
Lennart Poettering [Tue, 24 May 2016 19:28:11 +0000 (21:28 +0200)]
sd-ndisc: rework size checking in ndisc_ra_parse()
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.
Lennart Poettering [Tue, 24 May 2016 19:24:43 +0000 (21:24 +0200)]
sd-ndisc: simplify clamping of router "pref" parameter
Lennart Poettering [Tue, 24 May 2016 19:23:04 +0000 (21:23 +0200)]
sd-ndisc: append "event_source" to event source objects stored in structures
Otherwise it gets too confusing whether "timeout" refers to an event source or
just a timeout time specification.
Lennart Poettering [Tue, 24 May 2016 19:20:30 +0000 (21:20 +0200)]
sd-ndisc: add log_ndisc_errno() macro, to complement log_ndisc() like elsewhere
Also make use of it where appropriate.
Lennart Poettering [Tue, 24 May 2016 19:16:36 +0000 (21:16 +0200)]
sd-ndisc: use the right object to pass to log_ndisc()
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.
Lennart Poettering [Tue, 24 May 2016 19:15:49 +0000 (21:15 +0200)]
sd-ndisc: Typo fix: s/advertisment/advertisement/
Lennart Poettering [Mon, 23 May 2016 17:39:44 +0000 (19:39 +0200)]
ipv4acd: rename "ll" parameter to "acd" everywhere
Appears to be a (confusing) left-over from copy/paste when this still was
ipv4ll code.
Lennart Poettering [Mon, 23 May 2016 17:35:54 +0000 (19:35 +0200)]
sd-ipv4ll: add a bit of logging to IPv4LL too
Lennart Poettering [Mon, 23 May 2016 17:35:18 +0000 (19:35 +0200)]
sd-ipv4acd: drop IPV4ACD_NETWORK definition
Appears to be a copy/paste mistake from sd-ipv4ll. Let's get rid of this.
Lennart Poettering [Mon, 23 May 2016 17:24:21 +0000 (19:24 +0200)]
ipv4acd: rework how we pick ipv4ll addresses
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.
Lennart Poettering [Mon, 23 May 2016 16:33:17 +0000 (18:33 +0200)]
ipv4ll: change "seed" parameter to be uint64_t
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.
Lennart Poettering [Mon, 23 May 2016 16:26:49 +0000 (18:26 +0200)]
ipv4acd: make sure our event handler callbacks never check uninitialized "r" for errors
Lennart Poettering [Mon, 23 May 2016 16:18:04 +0000 (18:18 +0200)]
ipv4acd: normalize time types to usec_t
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.
Lennart Poettering [Mon, 23 May 2016 16:07:51 +0000 (18:07 +0200)]
ipv4acd: in case the state engine is reused, reset n_conflict timer to 0
Lennart Poettering [Mon, 23 May 2016 16:07:42 +0000 (18:07 +0200)]
ipv4acd: no need to memcpy() where assignment suffices
Lennart Poettering [Mon, 23 May 2016 16:06:33 +0000 (18:06 +0200)]
ipv4acd: introduce new "started" state
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.
Lennart Poettering [Mon, 23 May 2016 15:52:08 +0000 (17:52 +0200)]
ipv4acd: rename ipv4acd_stop() → ipv4acd_reset()
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.
Lennart Poettering [Mon, 23 May 2016 15:32:18 +0000 (17:32 +0200)]
ipv4acd: add "_event_source" suffix to event source objects
Otherwise the field "receive_message" is a bit too confusing, as it suggests it
actually stores a message object of some kind.
Lennart Poettering [Mon, 23 May 2016 15:23:40 +0000 (17:23 +0200)]
ipv4acd: make the iteration and conflict fields unsigned
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.
Lennart Poettering [Mon, 23 May 2016 15:19:35 +0000 (17:19 +0200)]
ipv4l-{acd,ll}: make sure ipv4 addresses are unsigned
And some other minor fixes.
Lennart Poettering [Mon, 23 May 2016 15:18:58 +0000 (17:18 +0200)]
ipv4acd: library code should never log
Or actually, not at any level higher than debug.
Lennart Poettering [Mon, 23 May 2016 15:17:37 +0000 (17:17 +0200)]
sd-ipv4{acl,ll}: don't make use of RefCnt objects
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.
Lennart Poettering [Mon, 23 May 2016 14:48:56 +0000 (16:48 +0200)]
sd-network: don't needlessly abbreviate "callback" as "cb" in struct members
It's OK to abbreviate this in the local scope, but otherwise, let's not be
needlessly terse.
Lennart Poettering [Mon, 23 May 2016 14:46:50 +0000 (16:46 +0200)]
dhcp: fix operator precedence issue with macro
Lennart Poettering [Mon, 23 May 2016 14:27:59 +0000 (16:27 +0200)]
sd-ndisc: make the _stop() call idempotent
It's a good idea to make stopcalls idempotent, so that they become nops if the
object is already stopped.
Lennart Poettering [Mon, 23 May 2016 14:27:05 +0000 (16:27 +0200)]
sd-network: fix up assertion chaos
assert_return() should only be used to validate user-facing parameters and
state, assert() should be used for checking our own internal state and
parameters.
Lennart Poettering [Mon, 23 May 2016 14:15:04 +0000 (16:15 +0200)]
sd-ndisc: rename sd_ndisc_init() to sd_ndisc_reset()
After all, it's actually used for resetting the state, not only for the initial
initialization.
While we are at it, also simplify the error path for
sd_ndisc_discovery_start().
Lennart Poettering [Mon, 23 May 2016 14:13:18 +0000 (16:13 +0200)]
sd-network: rename "index" field of the various clients to "ifindex"
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.
Lennart Poettering [Mon, 23 May 2016 13:57:39 +0000 (15:57 +0200)]
sd-ndisc: properly make various parameters unsigned
Lennart Poettering [Mon, 23 May 2016 13:57:31 +0000 (15:57 +0200)]
sd-dhcp: shorten NUL initialization a bit
Lennart Poettering [Mon, 23 May 2016 13:57:18 +0000 (15:57 +0200)]
manager: remove spurious newline
Lennart Poettering [Mon, 23 May 2016 13:56:01 +0000 (15:56 +0200)]
sd-network: unify packet processing logic a bit
Let's always check for errno being EAGAIN/EINTR the same way, and always log if
we receive weirdly short packets.
Ansgar Burchardt [Thu, 26 May 2016 08:44:35 +0000 (10:44 +0200)]
Typo: systemd-nspaw -> systemd-nspawn (#3354)
Tom Yan [Wed, 25 May 2016 12:40:48 +0000 (20:40 +0800)]
networkd: Disable IPv6 when DHCPv6 is only enabled
DHCPv6 requires an IPv6 link-local address to work. The client will not be started (even when enabled explicitly with `DHCP=`) if none is configured (either by autoconfiguration or manually). Therefore, disable IPv6 in such case.
Tom Yan [Wed, 25 May 2016 12:04:01 +0000 (20:04 +0800)]
networkd: set IFLA_INET6_ADDR_GEN_MODE as per stable_secret
Although networkd has option (LinkLocalAddressing=) to toggle IPv6LL autoconfiguration, when it is enabled, the address is autoconfigured by the kernel, but not networkd.
Therefore, we do not statically set IFLA_INET6_ADDR_GEN_MODE to IN6_ADDR_GEN_MODE_EUI64, but dynamically depending on whether stable_secret is set, just as what the kernel does by default.
Note that this does NOT affect the global addresses configured by networkd.
Lennart Poettering [Tue, 24 May 2016 10:14:21 +0000 (12:14 +0200)]
Merge pull request #3247 from fbuihuu/ask-passowrd-on-all-consoles
ask-password: ask for passphrases not only on the first console
Zbigniew Jędrzejewski-Szmek [Tue, 24 May 2016 10:07:42 +0000 (06:07 -0400)]
Udevadm trivial cleanups (#3331)
* udevadm-info: use _cleanup_
* udevadm-info: propagate return value from export_devices()
* sd-device: add comment and remove unnecessary braces
Werner Fink [Wed, 18 Nov 2015 11:28:30 +0000 (12:28 +0100)]
ask-password: ask for passphrases not only on the first console of /dev/console
but also on all other consoles. This does help on e.g. mainframes
where often a serial console together with other consoles are
used. Even rack based servers attachted to both a serial console
as well as having a virtual console do sometimes miss a connected
monitor.
To be able to ask on all terminal devices of /dev/console the devices
are collected. If more than one device are found, then on each of the
terminals a inquiring task for passphrase is forked and do not return
to the caller.
Every task has its own session and its own controlling terminal.
If one of the tasks does handle a password, the remaining tasks
will be terminated.
Also let contradictory options on the command of
systemd-tty-ask-password-agent fail.
Spwan for each device of the system console /dev/console a own process.
Replace the system call wait() with with system call waitid().
Use SIGTERM instead of SIGHUP to get unresponsive childs down.
Port the collect_consoles() function forward to a pulbic and strv
based function "get_kernel_consoles()" in terminal-util.c and use this
in tty-ask-password-agent.c.