chiark / gitweb /
elogind.git
5 years agobus: fix unitialized variable access in error path
Zbigniew Jędrzejewski-Szmek [Fri, 16 May 2014 03:27:59 +0000 (23:27 -0400)]
bus: fix unitialized variable access in error path

5 years agonetworkd: add missing files
Tom Gundersen [Fri, 16 May 2014 18:14:23 +0000 (20:14 +0200)]
networkd: add missing files

5 years agocore: let selinux_setup() load policy more than once
Will Woods [Fri, 25 Apr 2014 22:26:34 +0000 (18:26 -0400)]
core: let selinux_setup() load policy more than once

When you switch-root into a new root that has SELinux policy, you're
supposed to to run selinux_init_load_policy() to set up SELinux and load
policy. Normally this gets handled by selinux_setup().

But if SELinux was already initialized, selinux_setup() skips loading
policy and returns 0. So if you load policy normally, and then you
switch-root to a new root that has new policy, selinux_setup() never
loads the new policy. What gives?

As far as I can tell, this check is an artifact of how selinux_setup()
worked when it was first written (see commit c4dcdb9 / systemd v12):

  * when systemd starts, run selinux_setup()
  * if selinux_setup() loads policy OK, restart systemd

So the "if policy already loaded, skip load and return 0" check was
there to prevent an infinite re-exec loop.

Modern systemd only calls selinux_setup() on initial load and after
switch-root, and selinux_setup() no longer restarts systemd, so we don't
need that check to guard against the infinite loop anymore.

So: this patch removes the "return 0", thus allowing selinux_setup() to
actually perform SELinux setup after switch-root.

We still want to check to see if SELinux is initialized, because if
selinux_init_load_policy() fails *but* SELinux is initialized that means
we still have (old) policy active. So we don't need to halt if
enforce=1.

5 years agologind: allow suspending if there are no displays
Mantas Mikulėnas [Sun, 27 Apr 2014 21:58:56 +0000 (00:58 +0300)]
logind: allow suspending if there are no displays

With proprietary graphics drivers, there won't be any 'drm' devices in
sysfs, so logind will never suspend the system upon closing the lid,
even if only one (internal) display is connected. This has been reported
by multiple users so far.

IMHO, it's better to suspend the system in this case for safety reasons,
to avoid having nvidia blob users' laptops overheat, for the same reason
that sleep inhibitors are overridden (LidSwitchIgnoreInhibited=yes).

5 years agonetworkd: manager - read fallback DNS servers from config file
Tom Gundersen [Fri, 16 May 2014 17:44:22 +0000 (19:44 +0200)]
networkd: manager - read fallback DNS servers from config file

We will still use the compiled-in defaults if no DNS entry exists in the config file.

5 years agonetworkd: network - store DNS servers in List rather than Set
Tom Gundersen [Fri, 16 May 2014 17:43:12 +0000 (19:43 +0200)]
networkd: network - store DNS servers in List rather than Set

This way we preserve the order of preference.

5 years agonetworkd: also add IPv6 DNS servers by default
Tom Gundersen [Fri, 16 May 2014 15:34:43 +0000 (17:34 +0200)]
networkd: also add IPv6 DNS servers by default

5 years agonspawn: properly format container_uuid in UUID format
Lennart Poettering [Fri, 16 May 2014 17:37:19 +0000 (19:37 +0200)]
nspawn: properly format container_uuid in UUID format

http://lists.freedesktop.org/archives/systemd-devel/2014-April/018971.html

5 years agoman: update journald rate limit defaults
Mantas Mikulėnas [Wed, 30 Apr 2014 16:53:13 +0000 (19:53 +0300)]
man: update journald rate limit defaults

This brings the man page back into sync with the actual code.

5 years agopath-lookup: don't hardcode .config
Tanu Kaskinen [Sat, 3 May 2014 08:52:13 +0000 (11:52 +0300)]
path-lookup: don't hardcode .config

If XDG_CONFIG_HOME is set, then we should respect that.

5 years agopath-util: add path_make_relative()
Tanu Kaskinen [Sat, 3 May 2014 08:52:12 +0000 (11:52 +0300)]
path-util: add path_make_relative()

In user_dirs() in path-lookup.c, I want to replace this:
        symlink("../../../.config/systemd/user", data_home);
with
        symlink(config_home, data_home);
to avoid hardcoding .config when XDG_CONFIG_HOME is set.

The problem is that config_home is an absolute path, and it's better
to make the symlink relative. path_make_relative() is an utility
function that converts an absolute path into a relative one.

5 years agofsck: Allow to specify the fsck repair option in the cmdline
Holger Hans Peter Freyther [Thu, 15 May 2014 17:07:43 +0000 (19:07 +0200)]
fsck: Allow to specify the fsck repair option in the cmdline

Some unattended systems do not have a console attached and entering
the default rescue mode will not be too helpful. Allow to specify
the "-y" option to attempt to fix all filesystem errors.

Manually verified by downloading an image.gz of e2fsprogs, using
losetup and running systemd-fsck on the loop device and varying
the fsck.repair=preen|yes|no option.

5 years agonetworkd: hardcode a set of default dns servers
Tom Gundersen [Fri, 16 May 2014 13:24:09 +0000 (15:24 +0200)]
networkd: hardcode a set of default dns servers

Similarly to NTP servers, this can be set at compile-time.

5 years agoman: readahead: fix cmdline switch inconsistency between readahead.c and docs
Alison Chaiken [Fri, 16 May 2014 07:25:53 +0000 (09:25 +0200)]
man: readahead: fix cmdline switch inconsistency between readahead.c and docs

Source code has "files-max" and XML has --max-files.

5 years agoreadahead: modernizations
Lennart Poettering [Fri, 16 May 2014 15:07:51 +0000 (17:07 +0200)]
readahead: modernizations

5 years agoman: fix some minor language typos
Lennart Poettering [Fri, 16 May 2014 14:51:56 +0000 (16:51 +0200)]
man: fix some minor language typos

5 years agobuild-sys: at configure check for verifying that ln supports --relative
Lennart Poettering [Fri, 16 May 2014 14:51:42 +0000 (16:51 +0200)]
build-sys: at configure check for verifying that ln supports --relative

5 years agonetwork: always create /run/systemd/network/links
Lennart Poettering [Fri, 16 May 2014 13:56:44 +0000 (15:56 +0200)]
network: always create /run/systemd/network/links

This ways the networkd client library should work even if networkd is
not running.

http://lists.freedesktop.org/archives/systemd-devel/2014-May/019242.html

5 years agoRevert "networkd: order after udev kernel socket"
Tom Gundersen [Fri, 16 May 2014 12:48:58 +0000 (14:48 +0200)]
Revert "networkd: order after udev kernel socket"

This reverts commit a555350d47c4b70d716a63424933b34902c98300.

This did not fix the problem, just made it harder to hit.

5 years agonetworkd: log the initialization status of links
Tom Gundersen [Fri, 16 May 2014 12:47:43 +0000 (14:47 +0200)]
networkd: log the initialization status of links

5 years agoTODO
Tom Gundersen [Thu, 15 May 2014 22:26:37 +0000 (00:26 +0200)]
TODO

5 years agonetworkd: fix typo
Tom Gundersen [Thu, 15 May 2014 21:14:52 +0000 (23:14 +0200)]
networkd: fix typo

5 years agonetworkd: rename Address and Route list fields
Tom Gundersen [Thu, 15 May 2014 18:10:33 +0000 (20:10 +0200)]
networkd: rename Address and Route list fields

5 years agotimesyncd: fix typo in comment
Kay Sievers [Thu, 15 May 2014 23:27:57 +0000 (01:27 +0200)]
timesyncd: fix typo in comment

5 years agoman: clarify that the ExecReload= command should be synchronous
Lennart Poettering [Thu, 15 May 2014 23:33:22 +0000 (01:33 +0200)]
man: clarify that the ExecReload= command should be synchronous

http://lists.freedesktop.org/archives/systemd-devel/2014-May/019054.html

5 years agocore: make sure to serialize jobs for all units
Lennart Poettering [Thu, 15 May 2014 23:15:03 +0000 (01:15 +0200)]
core: make sure to serialize jobs for all units

Previously we wouldn't serialize jobs for units that themselves have
nothing to serialize.

http://lists.freedesktop.org/archives/systemd-devel/2014-May/019051.html

5 years agoUpdate TODO
Lennart Poettering [Thu, 15 May 2014 22:23:26 +0000 (00:23 +0200)]
Update TODO

5 years agotimesyncd: fix error path return value
Kay Sievers [Thu, 15 May 2014 18:50:02 +0000 (20:50 +0200)]
timesyncd: fix error path return value

https://bugs.freedesktop.org/show_bug.cgi?id=78752

5 years agotimesyncd: limit capabilities to CAP_SYS_TIME
Lennart Poettering [Thu, 15 May 2014 16:55:19 +0000 (18:55 +0200)]
timesyncd: limit capabilities to CAP_SYS_TIME

5 years agonetwork: fix build failure, missing KMOD_XXX flags
Cristian Rodríguez [Tue, 13 May 2014 23:35:20 +0000 (19:35 -0400)]
network: fix build failure, missing KMOD_XXX flags

- Add KMOD_CFLAGS and KMOD_LIBS where appropiate
- networkd now requires kmod. make --disable-kmod --enable-networkd
to raise an error.

5 years agologind: bring polkit policy for hibernate in line with suspend/poweroff/reboot
Lennart Poettering [Thu, 15 May 2014 16:30:07 +0000 (18:30 +0200)]
logind: bring polkit policy for hibernate in line with suspend/poweroff/reboot

THere's no reason why hibernate should be better protected then
suspendor poweroff, so sync the policies.

5 years agonetworkd: logging - align messages
Tom Gundersen [Thu, 15 May 2014 15:43:14 +0000 (17:43 +0200)]
networkd: logging - align messages

5 years agonetworkd: log ifindices when links and netdevs are added
Tom Gundersen [Thu, 15 May 2014 13:54:28 +0000 (15:54 +0200)]
networkd: log ifindices when links and netdevs are added

5 years agonetworkd: rename NetDev variable for consistency with Link
Tom Gundersen [Thu, 15 May 2014 13:48:37 +0000 (15:48 +0200)]
networkd: rename NetDev variable for consistency with Link

5 years agosd-bus: make sure we properly handle NULL callback functions
Lennart Poettering [Thu, 15 May 2014 15:54:32 +0000 (17:54 +0200)]
sd-bus: make sure we properly handle NULL callback functions

5 years agoselinux: fix build for non-selinux systems
Lennart Poettering [Thu, 15 May 2014 15:48:28 +0000 (17:48 +0200)]
selinux: fix build for non-selinux systems

5 years agosd-bus: fix an assert when running in kdbus mode
Lennart Poettering [Thu, 15 May 2014 15:42:39 +0000 (17:42 +0200)]
sd-bus: fix an assert when running in kdbus mode

5 years agoresolve: fix copy/paste error
Lennart Poettering [Thu, 15 May 2014 15:31:14 +0000 (17:31 +0200)]
resolve: fix copy/paste error

5 years agosd-bus: don't hit assert when installing match
Lennart Poettering [Thu, 15 May 2014 15:26:02 +0000 (17:26 +0200)]
sd-bus: don't hit assert when installing match

5 years agoupdate TODO
Lennart Poettering [Thu, 15 May 2014 15:25:46 +0000 (17:25 +0200)]
update TODO

5 years agosd-bus: always keep slot reference while dispatching callback
Lennart Poettering [Thu, 15 May 2014 15:08:24 +0000 (17:08 +0200)]
sd-bus: always keep slot reference while dispatching callback

Also, make sure we automatically destroy reply callbacks that are
floating.

5 years agosd-resolve: add "floating" resolve queries
Lennart Poettering [Thu, 15 May 2014 14:34:38 +0000 (16:34 +0200)]
sd-resolve: add "floating" resolve queries

Same story as for sd-bus and sd-event: allow passing NULL to store query
in in which case the query is freed automatically.

5 years agosd-event: introduce concept of "floating" event sources
Lennart Poettering [Wed, 14 May 2014 23:55:18 +0000 (01:55 +0200)]
sd-event: introduce concept of "floating" event sources

These are the counterpart of "floating" bus slots, i.e. event sources
that are bound to the lifetime of the event object itself, and thus
don't require an explicit reference to be kept.

5 years agocore: close socket fds asynchronously
Zbigniew Jędrzejewski-Szmek [Tue, 13 May 2014 21:22:13 +0000 (23:22 +0200)]
core: close socket fds asynchronously

http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html

5 years agosystemctl: small cleanup
Zbigniew Jędrzejewski-Szmek [Thu, 24 Apr 2014 15:23:38 +0000 (17:23 +0200)]
systemctl: small cleanup

5 years agoreadahead: add test to show fs_on_ssd() result
Zbigniew Jędrzejewski-Szmek [Wed, 14 May 2014 13:44:19 +0000 (09:44 -0400)]
readahead: add test to show fs_on_ssd() result

5 years agonetworkd, build-sys: spelling fix
Zbigniew Jędrzejewski-Szmek [Sun, 11 May 2014 12:34:26 +0000 (08:34 -0400)]
networkd, build-sys: spelling fix

5 years agoMake sure that keys are properly removed from hashmap
Zbigniew Jędrzejewski-Szmek [Fri, 18 Apr 2014 02:12:25 +0000 (22:12 -0400)]
Make sure that keys are properly removed from hashmap

This is a speculative fix for https://bugzilla.redhat.com/show_bug.cgi?id=1088865.
Even though I cannot find a code path that where this would be
an issue, for consistency, if we assume that cgroup_path might have
been set before we got to unit_deserialize, we should make sure that
the unit is removed from the hashmap before we free the key. This seems
to be the only place where the key could be prematurely freed, leading to
hashmap corruption.

5 years agoRemove unnecessary casts in printfs
Zbigniew Jędrzejewski-Szmek [Fri, 25 Apr 2014 11:45:15 +0000 (07:45 -0400)]
Remove unnecessary casts in printfs

No functional change expected :)

5 years agoMake systemctl --root look for files in the proper places
Zbigniew Jędrzejewski-Szmek [Thu, 24 Apr 2014 05:44:10 +0000 (01:44 -0400)]
Make systemctl --root look for files in the proper places

Running systemctl enable/disable/set-default/... with the --root
option under strace reveals that it accessed various files and
directories in the main fs, and not underneath the specified root.
This can lead to correct results only when the layout and
configuration in the container are identical, which often is not the
case. Fix this by adding the specified root to all file access
operations.

This patch does not handle some corner cases: symlinks which point
outside of the specified root might be interpreted differently than
they would be by the kernel if the specified root was the real root.
But systemctl does not create such symlinks by itself, and I think
this is enough of a corner case not to be worth the additional
complexity of reimplementing link chasing in systemd.

Also, simplify the code in a few places and remove an hypothetical
memory leak on error.

5 years agoshared/install: do not prefix created symlink with root path
Zbigniew Jędrzejewski-Szmek [Mon, 21 Apr 2014 23:17:40 +0000 (19:17 -0400)]
shared/install: do not prefix created symlink with root path

Before: /var/tmp/inst1//etc/systemd/system/default.target -> /var/tmp/inst1//usr/lib/systemd/system/graphical.target
After: /var/tmp/inst1/etc/systemd/system/default.target -> /usr/lib/systemd/system/graphical.target

5 years agoFix typos in systemctl manpage
Eelco Dolstra [Thu, 15 May 2014 11:11:00 +0000 (13:11 +0200)]
Fix typos in systemctl manpage

5 years agoudev: do not skip the execution of RUN when renaming a network device fails
Kay Sievers [Tue, 13 May 2014 22:34:49 +0000 (00:34 +0200)]
udev: do not skip the execution of RUN when renaming a network device fails

5 years agosd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached...
Lennart Poettering [Wed, 14 May 2014 23:15:30 +0000 (01:15 +0200)]
sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection

This makes callback behaviour more like sd-event or sd-resolve, and
creates proper object for unregistering callbacks.

Taking the refernce to the slot is optional. If not taken life time of
the slot will be bound to the underlying bus object (or in the case of
an async call until the reply has been recieved).

5 years agosd-event: reorder header slightly
Lennart Poettering [Wed, 14 May 2014 22:44:29 +0000 (00:44 +0200)]
sd-event: reorder header slightly

5 years agohashmap: add hashmap_remove2() to remove item from hashtable and return both value...
Lennart Poettering [Wed, 14 May 2014 22:43:44 +0000 (00:43 +0200)]
hashmap: add hashmap_remove2() to remove item from hashtable and return both value and key

5 years agocore: no need to pass bus object to selinux access check calls anymore
Lennart Poettering [Wed, 14 May 2014 20:44:45 +0000 (22:44 +0200)]
core: no need to pass bus object to selinux access check calls anymore

5 years agobus: add userdata API for bus name tracker objects
Lennart Poettering [Tue, 6 May 2014 17:15:36 +0000 (19:15 +0200)]
bus: add userdata API for bus name tracker objects

5 years agocore: sysvcompat - avoid repeated function call
Tom Gundersen [Wed, 14 May 2014 20:03:14 +0000 (22:03 +0200)]
core: sysvcompat - avoid repeated function call

5 years agocore: sysvcompat - $network should be equivalent to network-online, rather than netwo...
Tom Gundersen [Mon, 12 May 2014 19:26:54 +0000 (21:26 +0200)]
core: sysvcompat - $network should be equivalent to network-online, rather than network target

Most likely the  facility needed is actual connectivity, rather than whether or not the
network managment daemon is running.

We also need to explicitly pull in the network-online.target, as it is not active by
default.

This means {systemd-networkd,NetworkManager}-wait-online.service, can be enabled by default
as part of network-online.target, and only delay boot when some service actively pulls it in.

See: <https://bugzilla.gnome.org/show_bug.cgi?id=728965>

Cc: Pavel Šimerda <psimerda@redhat.com>
Cc: Michal Sekletar <msekleta@redhat.com>
5 years agoshared: add ring buffer
David Herrmann [Tue, 13 May 2014 18:08:18 +0000 (20:08 +0200)]
shared: add ring buffer

New "struct ring" object that implements a basic ring buffer for arbitrary
byte-streams. A new basic runtime test is also added.

This will be needed for our pty helpers for systemd-console and friends.

5 years agoshared: add ALIGN_POWER2 macro
David Herrmann [Tue, 13 May 2014 17:47:58 +0000 (19:47 +0200)]
shared: add ALIGN_POWER2 macro

Sounds easy, turns out to be horrible to implement: ALIGN_POWER2 returns
the next higher power of 2. clz(0) is undefined, same is true for
left-shift-overflows, yey, C rocks!

5 years agoreplace more dup() by F_DUPFD_CLOEXEC
Lennart Poettering [Tue, 13 May 2014 14:40:53 +0000 (16:40 +0200)]
replace more dup() by F_DUPFD_CLOEXEC

5 years agopam_systemd: use F_DUPFD_CLOEXEC when dupping session fds
Lennart Poettering [Tue, 13 May 2014 14:35:34 +0000 (16:35 +0200)]
pam_systemd: use F_DUPFD_CLOEXEC when dupping session fds

http://lists.freedesktop.org/archives/systemd-devel/2014-May/019034.html

5 years agoudev: rename netif - properly break lines in kmsg
Tom Gundersen [Tue, 13 May 2014 10:23:14 +0000 (12:23 +0200)]
udev: rename netif - properly break lines in kmsg

Before:

30,997,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6systemd-udevd[439]: renamed network interface wlan0 to wlp3s0
30,998,1175077801,c;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6

After:

30,834,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6
30,835,4732949,-;systemd-udevd[439]: renamed network interface wlan0 to wlp3s0
30,988,1175077801,-;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6

5 years agotimesyncd: start after networkd
Tom Gundersen [Tue, 13 May 2014 07:39:03 +0000 (09:39 +0200)]
timesyncd: start after networkd

This is needed for the network monitor to work (as it requires networkd to set up the correct directories first).

5 years agonetworkd-ipip-tunnel: add support ttl
Susant Sahani [Fri, 2 May 2014 17:59:56 +0000 (23:29 +0530)]
networkd-ipip-tunnel: add support ttl

Add support for ipip tunnel ttl.

5 years agonetworkd: Add todo patch kernel for tunnel module alias
Susant Sahani [Thu, 1 May 2014 10:46:55 +0000 (16:16 +0530)]
networkd: Add todo patch kernel for tunnel module alias

Add to todo :

1. Patch kernel to support module alias for tunnel device
2. Remove libkmod dependency from networkd

5 years agonetworkd: manager - don't leak kmod context
Tom Gundersen [Mon, 12 May 2014 15:11:13 +0000 (17:11 +0200)]
networkd: manager - don't leak kmod context

Also, keep the kmod_new internal to networkd-manager.c

5 years agonetworkd: unit - add cap to load modules
Tom Gundersen [Mon, 12 May 2014 15:37:52 +0000 (17:37 +0200)]
networkd: unit - add cap to load modules

Remember to drop this when the kernel gains autoloading for all netdev kinds.

5 years agonetworkd: introduce ipip tunnel
Susant Sahani [Mon, 12 May 2014 05:18:24 +0000 (10:48 +0530)]
networkd: introduce ipip tunnel

This patch enables basic ipip tunnel support.
It works with kernel module ipip

example conf:

file: ipip.netdev

[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480

[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64

file: ipip.network

[Match]
Name=em1

[Network]
Tunnel=ipip-tun

[tomegun:
         - drop unused variable
         - take ref when enslaving]

5 years agojob: always add waiting jobs to run queue during coldplug
Michael Marineau [Mon, 12 May 2014 07:26:16 +0000 (09:26 +0200)]
job: always add waiting jobs to run queue during coldplug

commit 20a83d7bf was not equivalent to the original bug fix proposed by
Michal Sekletar <msekleta@redhat.com>. The committed version only added
the job to the run queue if the job had a timeout, which most jobs do
not have. Just re-ordering the code gets us the intended functionality

5 years agonetworkd: get preexiting addresses when a link is added
Tom Gundersen [Sun, 11 May 2014 11:58:18 +0000 (13:58 +0200)]
networkd: get preexiting addresses when a link is added

5 years agonetworkd: listen for address changes
Tom Gundersen [Sat, 10 May 2014 17:39:03 +0000 (19:39 +0200)]
networkd: listen for address changes

This is proof-of-concept only, as we only log the changes but don't do anything
with it.

5 years agortnl: message - fix check for broadcast messages
Tom Gundersen [Sat, 10 May 2014 18:16:10 +0000 (20:16 +0200)]
rtnl: message - fix check for broadcast messages

5 years agortnl: message - read group membership of incoming messages
Tom Gundersen [Sat, 10 May 2014 18:15:52 +0000 (20:15 +0200)]
rtnl: message - read group membership of incoming messages

5 years agortnl: message - verify that we read the pending message size from the kernel
Tom Gundersen [Sat, 10 May 2014 17:55:00 +0000 (19:55 +0200)]
rtnl: message - verify that we read the pending message size from the kernel

Reuse the auth-checking for both the peek and the real read.

5 years agortnl: message - move code around
Tom Gundersen [Sat, 10 May 2014 17:40:11 +0000 (19:40 +0200)]
rtnl: message - move code around

No functional change.

5 years agortnl: change from bitmask to enum for rtnl groups
Tom Gundersen [Sat, 10 May 2014 17:38:32 +0000 (19:38 +0200)]
rtnl: change from bitmask to enum for rtnl groups

The bitmask is deprecated in the kernel, so move to the new interface. At the moment
this does not make a difference for us, but it avoids having to change the API in the future.

5 years agonetworkd: link - redo flag change logging
Tom Gundersen [Sat, 10 May 2014 14:08:03 +0000 (16:08 +0200)]
networkd: link - redo flag change logging

Make the logging less verbose by only printing all the changed flags on one line,
at the same time make it more complete by supporting all flags currently supported
by the kernel.

We still fall back to printing the raw flags in case we get something we do not recognize
This may be useful when running on new kernels.

5 years agosd-rtnl: message - add support for getting prefixlen from address messages
Tom Gundersen [Sat, 10 May 2014 14:06:23 +0000 (16:06 +0200)]
sd-rtnl: message - add support for getting prefixlen from address messages

5 years agonetworkd: network - fix leak
Tom Gundersen [Fri, 9 May 2014 16:05:42 +0000 (18:05 +0200)]
networkd: network - fix leak

5 years agonetworkd: manager - initialize variables
Tom Gundersen [Fri, 9 May 2014 16:02:14 +0000 (18:02 +0200)]
networkd: manager - initialize variables

5 years agonetworkd: netdev - rephrase logging message a bit
Tom Gundersen [Fri, 9 May 2014 16:00:20 +0000 (18:00 +0200)]
networkd: netdev - rephrase logging message a bit

Make it fit with what is logged from the link.

5 years agonetworkd: manager - refactor link tracking a bit
Tom Gundersen [Fri, 9 May 2014 15:59:20 +0000 (17:59 +0200)]
networkd: manager - refactor link tracking a bit

5 years agosystemctl: return an error code is status fails
Zbigniew Jędrzejewski-Szmek [Sat, 10 May 2014 01:44:25 +0000 (03:44 +0200)]
systemctl: return an error code is status fails

This got lost in the refactoring in f74294c1dabb4.

Also make sure that the return code corresponds to the *first* failure,
not the last.

https://lists.fedoraproject.org/pipermail/devel/2014-May/199080.html

5 years agonetworkd: link - don't log errors when missing routes/addresses are dropped
Tom Gundersen [Fri, 9 May 2014 12:23:17 +0000 (14:23 +0200)]
networkd: link - don't log errors when missing routes/addresses are dropped

We were ignoring the wrong errno.

5 years agonetworkd: link - handle links coming back to life
Tom Gundersen [Fri, 9 May 2014 10:11:15 +0000 (12:11 +0200)]
networkd: link - handle links coming back to life

When enslaving devices, we may receieve DELLINK/NEWLINK for the same ifindex,
let's not be confused by this.

5 years agonetworkd: reorder bonding and bridging
Tom Gundersen [Fri, 9 May 2014 10:20:21 +0000 (12:20 +0200)]
networkd: reorder bonding and bridging

A link should only ever be part of one, but if we accidentally do both, let's do it
in the right order so the failure is more obvious in the logs.

5 years agosd-dhcp-client: improve logging when stopping client
Tom Gundersen [Thu, 8 May 2014 22:26:22 +0000 (00:26 +0200)]
sd-dhcp-client: improve logging when stopping client

'Requested by user' was confusing, just drop it.

5 years agonetworkd: manager - drop links and netdevs when we receive DELLINK
Tom Gundersen [Thu, 8 May 2014 16:55:11 +0000 (18:55 +0200)]
networkd: manager - drop links and netdevs when we receive DELLINK

5 years agonetworkd: netdev - drop if creation fails
Tom Gundersen [Thu, 8 May 2014 19:08:12 +0000 (21:08 +0200)]
networkd: netdev - drop if creation fails

This ensures that all links waiting to be enslaved are notified that the netdev does not exist.

5 years agonetworkd: link - introduce LINGER state and link_drop()
Tom Gundersen [Thu, 8 May 2014 18:50:05 +0000 (20:50 +0200)]
networkd: link - introduce LINGER state and link_drop()

We need the LINGER state in case we still have references to the link after it has been dropped.

5 years agonetworkd: netdev - introduce LINGER state and netdev_drop()
Tom Gundersen [Thu, 8 May 2014 18:42:22 +0000 (20:42 +0200)]
networkd: netdev - introduce LINGER state and netdev_drop()

We need the LINGER state in case we still have references to the netdev after it has been dropped.

5 years agonetworkd: netdev - cancel all callbacks when freeing
Tom Gundersen [Thu, 8 May 2014 18:40:56 +0000 (20:40 +0200)]
networkd: netdev - cancel all callbacks when freeing

This notifies the link that the netdev no longer exists.

5 years agonetworkd: link - take refcounts on links
Tom Gundersen [Thu, 8 May 2014 17:46:06 +0000 (19:46 +0200)]
networkd: link - take refcounts on links

We need to take a refcount on the link whenever we expect a callback. The exceptions
are the ipv4ll/dhcp clients as their lifetimes are guaranteed to be shorter than that
of the link.

5 years agonetworkd: network - do reference counting on netdevs
Tom Gundersen [Thu, 8 May 2014 17:28:17 +0000 (19:28 +0200)]
networkd: network - do reference counting on netdevs

5 years agonetworkd: network - merge all netdev parsing into one function
Tom Gundersen [Thu, 8 May 2014 17:22:53 +0000 (19:22 +0200)]
networkd: network - merge all netdev parsing into one function

5 years agonetworkd: introduce refcounting for Links and NetDevs
Tom Gundersen [Thu, 8 May 2014 16:54:26 +0000 (18:54 +0200)]
networkd: introduce refcounting for Links and NetDevs

5 years agonetworkd: link - clean up state files
Tom Gundersen [Thu, 8 May 2014 16:53:32 +0000 (18:53 +0200)]
networkd: link - clean up state files

Also keep the path to the lease file around rather than regenarating it all the time.