chiark / gitweb /
elogind.git
5 years agosystemctl: delete REBOOT_PARAM_FILE if no parameter is specified
Michael Olbrich [Tue, 25 Mar 2014 13:15:44 +0000 (14:15 +0100)]
systemctl: delete REBOOT_PARAM_FILE if no parameter is specified

And move it to sperate function.

5 years agoimplement a union to pad out file_handle
Dave Reisner [Sat, 19 Apr 2014 17:22:35 +0000 (13:22 -0400)]
implement a union to pad out file_handle

Cases where name_to_handle_at is used allocated the full struct to be
MAX_HANDLE_SZ, and assigned this size to handle_bytes. This is wrong
since handle_bytes should describe the length of the flexible array
member and not the whole struct.

Define a union type which includes sufficient padding to allow
assignment of MAX_HANDLE_SZ to be correct.

5 years agocondense assignment and path_kill_slashes calls
Dave Reisner [Wed, 16 Apr 2014 02:16:40 +0000 (22:16 -0400)]
condense assignment and path_kill_slashes calls

5 years agodoc: fix items' names in PORTING-DBUS1
Lukasz Skalski [Thu, 10 Apr 2014 12:50:23 +0000 (14:50 +0200)]
doc: fix items' names in PORTING-DBUS1

5 years agoRemove duplicate includes
Bas van den Berg [Tue, 8 Apr 2014 09:14:16 +0000 (11:14 +0200)]
Remove duplicate includes

5 years agosilence warnings
Thomas Hindoe Paaboel Andersen [Sun, 20 Apr 2014 22:02:35 +0000 (00:02 +0200)]
silence warnings

5 years agonetworkd: link - add explicit unmanaged state
Tom Gundersen [Sun, 20 Apr 2014 17:49:00 +0000 (19:49 +0200)]
networkd: link - add explicit unmanaged state

5 years agonetworkd: link - set mac addresses when starting clients
Tom Gundersen [Sun, 20 Apr 2014 17:34:51 +0000 (19:34 +0200)]
networkd: link - set mac addresses when starting clients

MAC addreses are also set when NEWLINK messages are receieved, but only if the clients have
already been initialized.

5 years agosd-dhcp-client: log ifindex and mac address when starting
Tom Gundersen [Sun, 20 Apr 2014 17:10:02 +0000 (19:10 +0200)]
sd-dhcp-client: log ifindex and mac address when starting

5 years agonetworkd: link - log changes in some common link flags
Tom Gundersen [Sun, 20 Apr 2014 11:08:59 +0000 (13:08 +0200)]
networkd: link - log changes in some common link flags

5 years agonetworkd: link - use IFF_DORMANT instead of IFF_RUNNING
Tom Gundersen [Sun, 20 Apr 2014 08:28:19 +0000 (10:28 +0200)]
networkd: link - use IFF_DORMANT instead of IFF_RUNNING

Should be no functional change, but avoids spurious log
messages when in operstate UNKNOWN and !IFF_LOWER_UP.

5 years agonetworkd: link - make debug logging a bit more readable
Tom Gundersen [Sun, 20 Apr 2014 10:59:24 +0000 (12:59 +0200)]
networkd: link - make debug logging a bit more readable

Drop leading zeros which will never be used when printing the link flags.

5 years agoudev: link-config - treat any non-random mac address as persistent
Tom Gundersen [Sun, 20 Apr 2014 05:53:16 +0000 (07:53 +0200)]
udev: link-config - treat any non-random mac address as persistent

The address may be already changed by other processes, or set
when creating the netdev from userspace.

5 years agosd-rtnl: log when queues are exhausted
Tom Gundersen [Sun, 20 Apr 2014 05:51:28 +0000 (07:51 +0200)]
sd-rtnl: log when queues are exhausted

5 years agocryptsetup: copy value, not key for (rd.)luks.key
Matthew Monaco [Sat, 19 Apr 2014 18:56:45 +0000 (12:56 -0600)]
cryptsetup: copy value, not key for (rd.)luks.key

5 years agoHandle Unix domain socket connections from outside our namespace v2
Zbigniew Jędrzejewski-Szmek [Sun, 20 Apr 2014 01:58:03 +0000 (21:58 -0400)]
Handle Unix domain socket connections from outside our namespace v2

This is a second attempt at 9754d56, reverted in 2f20a8e, because
I lost a 'break;' when moving chunks around.

5 years agonetworkd: order after udev kernel socket
Tom Gundersen [Sat, 19 Apr 2014 20:13:49 +0000 (22:13 +0200)]
networkd: order after udev kernel socket

Otherwise we will not be able to queuery whether devices are initialized on kdbus enabled systems.

5 years agonetworkd: manager - add a bit of debug output to udev ADD events
Tom Gundersen [Sat, 19 Apr 2014 18:49:06 +0000 (20:49 +0200)]
networkd: manager - add a bit of debug output to udev ADD events

5 years agonetworkd: link - track interface renames
Tom Gundersen [Sat, 19 Apr 2014 18:39:17 +0000 (20:39 +0200)]
networkd: link - track interface renames

5 years agosd-rtnl: socet_read_message - make sure we only shrink the partial rqueue when proces...
Tom Gundersen [Sat, 19 Apr 2014 18:32:01 +0000 (20:32 +0200)]
sd-rtnl: socet_read_message - make sure we only shrink the partial rqueue when processing multi-part message

5 years agonetwork: implement masking of .link, .network and .netdev files
Tom Gundersen [Sat, 19 Apr 2014 17:05:37 +0000 (19:05 +0200)]
network: implement masking of .link, .network and .netdev files

5 years agonetworkd: netdev - give up early when setting already set ifindex
Tom Gundersen [Sat, 19 Apr 2014 15:14:36 +0000 (17:14 +0200)]
networkd: netdev - give up early when setting already set ifindex

We may receive RTM_NEWLINK messages with missing LINKINFO after the initial NEWLINK message,
don't bother verifying these, just drop out early after checking that the ifindex is not in conflict.

5 years agonetworkd: netdev - verify name of newlink messages
Tom Gundersen [Fri, 18 Apr 2014 08:28:42 +0000 (10:28 +0200)]
networkd: netdev - verify name of newlink messages

5 years agonetworkd: netdev - set predictable mac address when creating netdev
Tom Gundersen [Thu, 17 Apr 2014 22:50:40 +0000 (00:50 +0200)]
networkd: netdev - set predictable mac address when creating netdev

5 years agonetworkd: tie links to rtnl rather than udev
Tom Gundersen [Tue, 15 Apr 2014 12:21:44 +0000 (14:21 +0200)]
networkd: tie links to rtnl rather than udev

This essentially swaps the roles of rtnl and udev in networkd. After this
change libudev is only used for waiting for udev to initialize devices and
to get udev-specific information needed for some [Match] attributes.

This in particular simplifies the code in containers where udev is not really
useful, but also simplifies things and reduces round-trips in the non-container
case.

5 years agonss-myhostname: port to sd-rtnl
Tom Gundersen [Mon, 14 Apr 2014 10:46:09 +0000 (12:46 +0200)]
nss-myhostname: port to sd-rtnl

5 years agosd-rtnl: message - expose DUMP flag in the api
Tom Gundersen [Mon, 14 Apr 2014 16:07:34 +0000 (18:07 +0200)]
sd-rtnl: message - expose DUMP flag in the api

5 years agosd-rtnl: add multi-part message test
Tom Gundersen [Thu, 17 Apr 2014 09:12:41 +0000 (11:12 +0200)]
sd-rtnl: add multi-part message test

5 years agosd-rtnl: message - concatenate multi-part messages from different packets
Tom Gundersen [Thu, 17 Apr 2014 19:32:25 +0000 (21:32 +0200)]
sd-rtnl: message - concatenate multi-part messages from different packets

5 years agosd-rtnl: message - don't put NULL message on rqueue
Tom Gundersen [Wed, 16 Apr 2014 16:17:24 +0000 (18:17 +0200)]
sd-rtnl: message - don't put NULL message on rqueue

If nothing interesting was receieved we should not put anything on
the queue.

5 years agosd-rtnl: message - make room for all pending messages, not just the first
Tom Gundersen [Tue, 15 Apr 2014 10:01:39 +0000 (12:01 +0200)]
sd-rtnl: message - make room for all pending messages, not just the first

Also, don't actually read any of the message when peeking, just get its length.

5 years agoRevert "Handle Unix domain socket connections from outside our namespace"
Kay Sievers [Sat, 19 Apr 2014 11:53:11 +0000 (13:53 +0200)]
Revert "Handle Unix domain socket connections from outside our namespace"

This reverts commit 9754d56e9b21bfe89fc18f47987d6bef491b8521.

It causes a crash in PID1:
  Apr 19 13:49:32 lon systemd[1]: Code should not be reached 'Unhandled socket type.'
                                  at src/core/socket.c:684, function instance_from_socket(). Aborting.
  Apr 19 13:49:32 lon systemd[1]: Caught <ABRT>, dumped core as pid 336.
  Apr 19 13:49:32 lon systemd[1]: Freezing execution.

5 years agotmpfiles: fix permissions on new journal files
Greg KH [Tue, 15 Apr 2014 21:12:01 +0000 (14:12 -0700)]
tmpfiles: fix permissions on new journal files

When starting up journald on a new system, set the proper permissions on
the system.journal files, not only on the journal directory.

5 years agobuild-sys: do not try to build test-rtnl-manual w/o kmod
Zbigniew Jędrzejewski-Szmek [Fri, 18 Apr 2014 03:39:40 +0000 (23:39 -0400)]
build-sys: do not try to build test-rtnl-manual w/o kmod

5 years agobuild-sys: add libkmod flags for test_rtnl_manual
Łukasz Stelmach [Mon, 14 Apr 2014 13:14:14 +0000 (15:14 +0200)]
build-sys: add libkmod flags for test_rtnl_manual

5 years agocore: minor typo fix
Ali H. Caliskan [Mon, 14 Apr 2014 17:30:16 +0000 (19:30 +0200)]
core: minor typo fix

5 years agodelta: do not use unicode chars in C locale
Zbigniew Jędrzejewski-Szmek [Thu, 17 Apr 2014 03:33:41 +0000 (23:33 -0400)]
delta: do not use unicode chars in C locale

https://bugzilla.redhat.com/show_bug.cgi?id=1088418

5 years agoinstall: create_symlink() check unlink() return value
Djalal Harouni [Thu, 17 Apr 2014 00:47:11 +0000 (01:47 +0100)]
install: create_symlink() check unlink() return value

create_symlink() do not check the return value of unlink(), this may
confuse the user.

Before the unlink() call we check the 'force' argument. If it is not set
we fail with -EEXIST, otherwise we unlink() the file, therefore the next
symlink() should not fail with -EEXIST (do not count races...).

However since callers may not have appropriate privileges to unlink()
the file we lose the -EPERM or any other errno code of unlink(), and
return the -EEXIST of the next symlink(). Fix this by checking unlink()
results.

Before:
$ systemctl --force --root=~/container-03 set-default multi-user.target
Failed to set default target: File exists

After:
$ systemctl --force --root=~/container-03 set-default multi-user.target
Failed to set default target: Permission denied

5 years agosystemctl: allow to change the default target without the --force switch
Djalal Harouni [Mon, 14 Apr 2014 00:07:52 +0000 (01:07 +0100)]
systemctl: allow to change the default target without the --force switch

Currently "systemctl set-default" will fail to change the default target
due to the 'default.target' being a symlink which is always the case.

To work around this, the user must specify the "--force" switch to be
able to overwrite the existing symlink.

This is clearly a regression that was introduced by commit  718db96199e
since it worked before without the "--force" switch and the man pages do
not mention that you need to specify it. It is expected that this is a
symlink.

So just explicity set the force flag to make it work again.

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

Reported-by: <code@progandy.de>
5 years agoHandle Unix domain socket connections from outside our namespace
Eelco Dolstra [Wed, 16 Apr 2014 16:39:07 +0000 (18:39 +0200)]
Handle Unix domain socket connections from outside our namespace

NixOS uses Unix domain sockets for certain host <-> container
interaction; i.e. the host connects to a socket visible in the
container's directory tree, where the container uses a .socket unit to
spawn the handler program on demand. This worked in systemd 203, but
in 212 fails with "foo.socket failed to queue service startup job
(Maybe the service file is missing or not a template unit?): No data
available".

The reason is that getpeercred() now returns ENODATA if it can't get
the PID of the client, which happens in this case because the client
is not in the same PID namespace. Since getpeercred() is only used to
generate the instance name, this patch simply handles ENODATA by
creating an instance name "<nr>-unknown".

[zj: reorder clauses and remove (unsigned long) casts.]

5 years agoman: document relationship between RequiresMountsFor and noauto
Zbigniew Jędrzejewski-Szmek [Thu, 17 Apr 2014 02:15:42 +0000 (22:15 -0400)]
man: document relationship between RequiresMountsFor and noauto

https://bugzilla.redhat.com/show_bug.cgi?id=1088057

5 years agotest-path-util: fix running with separate build dir
Zbigniew Jędrzejewski-Szmek [Thu, 17 Apr 2014 02:04:31 +0000 (22:04 -0400)]
test-path-util: fix running with separate build dir

test-path-utils attempts to find itself, but if the binary is not
in current directory, the test would fail.

5 years agosysctl: replaces some slashes with dots
Zbigniew Jędrzejewski-Szmek [Thu, 17 Apr 2014 01:33:46 +0000 (21:33 -0400)]
sysctl: replaces some slashes with dots

It turns out that plain sysctl understands a.b/c syntax to write to
/proc/sys/a/b.c. Support this for compatibility.

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

5 years agosystemctl: add --recursive for list-timers
Thomas Hindoe Paaboel Andersen [Wed, 16 Apr 2014 21:50:19 +0000 (23:50 +0200)]
systemctl: add --recursive for list-timers

5 years agosystemctl: add --recursive for list-sockets
Thomas Hindoe Paaboel Andersen [Tue, 15 Apr 2014 22:37:17 +0000 (00:37 +0200)]
systemctl: add --recursive for list-sockets

5 years agobus-proxy: remove unused variable
Thomas Hindoe Paaboel Andersen [Mon, 14 Apr 2014 19:01:55 +0000 (21:01 +0200)]
bus-proxy: remove unused variable

5 years agocgls: avoid writing an unused value
Thomas Hindoe Paaboel Andersen [Mon, 14 Apr 2014 18:51:45 +0000 (20:51 +0200)]
cgls: avoid writing an unused value

silences a build-scan warning for the unused value in r

5 years agotimedatectl: avoid using uninitialized var
Thomas Hindoe Paaboel Andersen [Mon, 14 Apr 2014 17:16:56 +0000 (19:16 +0200)]
timedatectl: avoid using uninitialized var

sec is not set if have_time is false so avoid using it. have_time
was introduced in 9ff09bcb86fb125768667aca9bc0b10b1745370a but only
the first uses for sec were covered

Found with scan-build

5 years agoman: fix typos in sd_event_new
Thomas Hindoe Paaboel Andersen [Mon, 14 Apr 2014 17:12:45 +0000 (19:12 +0200)]
man: fix typos in sd_event_new

5 years agonetworkd: link - make state changing logging a bit less verbose
Tom Gundersen [Mon, 14 Apr 2014 15:55:47 +0000 (17:55 +0200)]
networkd: link - make state changing logging a bit less verbose

5 years agosd-rtnl: message_addr - allow dumping of messages
Tom Gundersen [Mon, 14 Apr 2014 10:42:11 +0000 (12:42 +0200)]
sd-rtnl: message_addr - allow dumping of messages

5 years agosd-rtnl: socket_read - use a read buffer
Tom Gundersen [Mon, 14 Apr 2014 15:20:51 +0000 (17:20 +0200)]
sd-rtnl: socket_read - use a read buffer

Rather than allocating/freeing memory for each message read, keep a global read buffer
in the rtnl object. Also, rather than using a fixed size, peek at the pending message
header to get the message size and reallocate as necessary.

5 years agosd-rtnl: multi-part message - store as linked-list rather than independent messages
Tom Gundersen [Sun, 13 Apr 2014 19:37:53 +0000 (21:37 +0200)]
sd-rtnl: multi-part message - store as linked-list rather than independent messages

This means the API can stay the same as for single-part messages by simply passing the head message around. Unrefing
the head of the linked list unrefs the whole list.

5 years agosd-rtnl: message_addr - expose a few more getters
Tom Gundersen [Mon, 14 Apr 2014 10:41:13 +0000 (12:41 +0200)]
sd-rtnl: message_addr - expose a few more getters

5 years agonetworkd: link - ignore missing MAC address from NEWLINK message
Tom Gundersen [Sun, 13 Apr 2014 20:10:34 +0000 (22:10 +0200)]
networkd: link - ignore missing MAC address from NEWLINK message

The kernel may broadcast such messages, simply discard them.

5 years agohwdb: PCI - include "primary" model string in subsystem model string
Kay Sievers [Mon, 14 Apr 2014 14:54:35 +0000 (07:54 -0700)]
hwdb: PCI - include "primary" model string in subsystem model string

The data in the PCI ids file is randomly inconsistent. Many
subvendor model strings just describe the "product" where the
hardware is built into, not the hardware itself. This causes
some "Network Card Model Foo" to show up as "Laptop Model Bar".

Try to make the best out of this mess and concatenate both
strings to describe the hardware.

5 years agohwdb: update
Kay Sievers [Mon, 14 Apr 2014 06:46:27 +0000 (23:46 -0700)]
hwdb: update

5 years agoutil: ignore kernel errors reported via close(), unless it is EBADF
Lennart Poettering [Mon, 14 Apr 2014 03:00:42 +0000 (20:00 -0700)]
util: ignore kernel errors reported via close(), unless it is EBADF

The kernel can return pretty much anything there, even though the fd is
closed. Let's not get confused by that.

5 years agoudev: serialize/synchronize block device event handling with file locks
Kay Sievers [Mon, 14 Apr 2014 02:54:27 +0000 (19:54 -0700)]
udev: serialize/synchronize block device event handling with file locks

5 years agobus-proxy: when replying to bus calls set a synthetic serial number and patch the...
Lennart Poettering [Mon, 14 Apr 2014 02:43:00 +0000 (19:43 -0700)]
bus-proxy: when replying to bus calls set a synthetic serial number and patch the sender address

Otherwise old libdbus1 is confused and will not accept our replies.

5 years agobus: process AddMatch/RemoveMatch driver call in proxy
Lennart Poettering [Mon, 14 Apr 2014 01:25:10 +0000 (18:25 -0700)]
bus: process AddMatch/RemoveMatch driver call in proxy

Previously, AddMatch/RemoveMatch calls where processed exclusively in
the proxy. That's racy however, since subscribing to a signal might not
complete before the signal is sent due to some subsequent method call.
Hence, in order to expose the same ordering guarantees as dbus1 process
the AddMatch/RemoveMatch calls from the proxy, so that they are
dispatched synchronously to all following messages, thus fixing the
race.

Ultimately, we should probabably dissolve the driver entirely into the
proxy, as it is purely a compatibility feature anyway...

5 years agoman: explain that the timestamps on incoming kdbus messages are not necessarily monot...
Lennart Poettering [Mon, 14 Apr 2014 00:42:11 +0000 (17:42 -0700)]
man: explain that the timestamps on incoming kdbus messages are not necessarily monotonically increasing

5 years agoupdate TODO
Lennart Poettering [Mon, 14 Apr 2014 00:41:51 +0000 (17:41 -0700)]
update TODO

5 years agobuild-sys: add Makefile symlink
Lennart Poettering [Tue, 1 Apr 2014 17:13:42 +0000 (19:13 +0200)]
build-sys: add Makefile symlink

5 years agoupdate TODO
Lennart Poettering [Tue, 1 Apr 2014 17:13:22 +0000 (19:13 +0200)]
update TODO

5 years agoman: add man page for sd_event_new()
Lennart Poettering [Tue, 1 Apr 2014 17:12:59 +0000 (19:12 +0200)]
man: add man page for sd_event_new()

5 years agoudev: remove seqnum API and all assumptions about seqnums
Kay Sievers [Sun, 13 Apr 2014 05:35:50 +0000 (22:35 -0700)]
udev: remove seqnum API and all assumptions about seqnums

The way the kernel namespaces have been implemented breaks assumptions
udev made regarding uevent sequence numbers. Creating devices in a
namespace "steals" uevents and its sequence numbers from the host. It
confuses the "udevadmin settle" logic, which might block until util a
timeout is reached, even when no uevent is pending.

Remove any assumptions about sequence numbers and deprecate libudev's
API exposing these numbers; none of that can reliably be used anymore
when namespaces are involved.

5 years agobash completion: fix __get_startable_units
Dan Kilman [Sun, 13 Apr 2014 15:06:13 +0000 (18:06 +0300)]
bash completion: fix __get_startable_units

5 years agopath-util: also check for existence of binary when given absolute path
Zbigniew Jędrzejewski-Szmek [Sat, 12 Apr 2014 21:17:49 +0000 (17:17 -0400)]
path-util: also check for existence of binary when given absolute path

In contrast to a filename-only argument, find_binary() did not
actually check if an path exists, allowing the code to fail later on.
This was OK, but it seems nicer to treat both paths identically.

Also take advantage of path_make_absolute_cwd doing strdup() by itself
if necessary to simplify.

5 years agofsck: Search for fsck.type in PATH
Mike Gilbert [Sat, 12 Apr 2014 20:07:45 +0000 (16:07 -0400)]
fsck: Search for fsck.type in PATH

Modifies find_binary() to accept NULL in the second argument.

fsck.type lookup logic moved to new fsck_exists() function, with a test.

5 years agohwdb: Update database of Bluetooth company identifiers
Marcel Holtmann [Sat, 12 Apr 2014 17:38:16 +0000 (10:38 -0700)]
hwdb: Update database of Bluetooth company identifiers

5 years agoman: mention XDG_CONFIG_HOME in systemd.unit
Tanu Kaskinen [Sat, 12 Apr 2014 05:37:38 +0000 (08:37 +0300)]
man: mention XDG_CONFIG_HOME in systemd.unit

5 years agobuild: if -fstack-protector-strong is available, use it.
Cristian Rodríguez [Sat, 12 Apr 2014 01:57:02 +0000 (22:57 -0300)]
build: if -fstack-protector-strong is available, use it.

5 years agocore: Make sure a stamp file exists for all Persistent=true timers
Thomas Bächler [Wed, 2 Apr 2014 18:18:44 +0000 (20:18 +0200)]
core: Make sure a stamp file exists for all Persistent=true timers

If a persistent timer has no stamp file yet, it behaves just like a normal
timer until it runs for the first time. If the system is always shut down
while the timer is supposed to run, a stamp file is never created and
Peristent=true has no effect.

This patch fixes this by creating a stamp file with the current time
when the timer is first started.

5 years agojournal: properly detect language specified in line
Zbigniew Jędrzejewski-Szmek [Sat, 12 Apr 2014 00:57:27 +0000 (20:57 -0400)]
journal: properly detect language specified in line

... it turns out that the duplicates in our own catalog were not real
duplicates, but translations.

5 years agojournal: cleanup up error handling in update_catalog()
Zbigniew Jędrzejewski-Szmek [Fri, 11 Apr 2014 12:44:55 +0000 (08:44 -0400)]
journal: cleanup up error handling in update_catalog()

- Negative/positive errno mixup caused duplicates not to be detected properly.
  Now we get a warning about some duplicate entries in our own catalogs...
- Errors in update_catalog would be ignored, but they should not be.

5 years agotest-dhcp-client: unref lease objects to make valgrind happy
Zbigniew Jędrzejewski-Szmek [Fri, 11 Apr 2014 03:45:46 +0000 (23:45 -0400)]
test-dhcp-client: unref lease objects to make valgrind happy

Also unref client objects in test code, and initalize logging,
to DEBUG by default.

5 years agoUnify GREEDY_REALLOC and GREEDY_REALLOC_T
Zbigniew Jędrzejewski-Szmek [Thu, 10 Apr 2014 13:48:59 +0000 (09:48 -0400)]
Unify GREEDY_REALLOC and GREEDY_REALLOC_T

greedy_realloc() and greedy_realloc0() now store the allocated
size as the count, not bytes.

Replace GREEDY_REALLOC uses with GREEDY_REALLOC_T everywhere,
and then rename GREEDY_REALLOC_T to GREEDY_REALLOC. It is just
too error-prone to have two slightly different macros which do the
same thing.

5 years agonetworkd: link - require both RUNNING and LOWER_UP before using link
Tom Gundersen [Sat, 12 Apr 2014 10:27:22 +0000 (12:27 +0200)]
networkd: link - require both RUNNING and LOWER_UP before using link

Usually RUNNING implies LOWER_UP, but for drivers that don't support oper state, RUNNING can
also mean that the state is unknown. In that case we should just trust LOWER_UP directly.

5 years agonetworkd: wait for IFF_RUNNING rather than IFF_LOWER_UP
Tom Gundersen [Sat, 12 Apr 2014 10:05:43 +0000 (12:05 +0200)]
networkd: wait for IFF_RUNNING rather than IFF_LOWER_UP

The interface is not fully ready until it enterns RUNNING. This was causing
problems with sending out DHCP messages before the interface was ready, so they
would get lost. In particular this affected DHCP INIT-REBOOT, as it relies on
the first package sent being successful (or it will fall back to a full reboot).

Also improve the logging a lot, to make future debugging of link state a lot
easier.

5 years agosd-dhcp-client: drop logging about T1/T2
Tom Gundersen [Sat, 12 Apr 2014 09:20:28 +0000 (11:20 +0200)]
sd-dhcp-client: drop logging about T1/T2

These are redundant now that the REQUEST messages contain the same information.

5 years agosd-dhcp-client: improve logging
Tom Gundersen [Fri, 11 Apr 2014 23:01:13 +0000 (01:01 +0200)]
sd-dhcp-client: improve logging

Specify what kind of REQUEST we send, and distinguish between REBOOT and START.
Also log stop reasons as strings rather than numbers.

5 years agosd-dhcp-client: use client_initialiez and client_restart for REBOOT
Tom Gundersen [Fri, 11 Apr 2014 22:34:05 +0000 (00:34 +0200)]
sd-dhcp-client: use client_initialiez and client_restart for REBOOT

5 years agonetworkd: add an assert
Tom Gundersen [Fri, 11 Apr 2014 21:57:18 +0000 (23:57 +0200)]
networkd: add an assert

This error should never happen, so replace the check with an assert. The check
was anyway broken due to an uninitialized return value.

Reported by Thomas Hindoe Paaboel Andersen <phomes@gmail.com>.

5 years agosd-dhcp-client: document message creation a bit more
Tom Gundersen [Fri, 11 Apr 2014 19:02:16 +0000 (21:02 +0200)]
sd-dhcp-client: document message creation a bit more

Also reshuffle some code to make the correspondence with the RFC a bit more
obvious.

Small functional change: fail if we try to send a message from the wrong state.

5 years agosd-dhcp-client: assert that we can only create DISCOVER or REQUEST messages
Tom Gundersen [Fri, 11 Apr 2014 17:54:04 +0000 (19:54 +0200)]
sd-dhcp-client: assert that we can only create DISCOVER or REQUEST messages

5 years agosd-dhcp-client: rebind raw socket when resetting transaction id
Tom Gundersen [Fri, 11 Apr 2014 16:02:54 +0000 (18:02 +0200)]
sd-dhcp-client: rebind raw socket when resetting transaction id

As we are now filtering the raw socket based on the transaction id, we must
reset the BPF when we reset the transaction id.

5 years agosd-ipv4ll: Add an explicit stop state for IPv4LL
Patrik Flykt [Wed, 9 Apr 2014 10:12:10 +0000 (13:12 +0300)]
sd-ipv4ll: Add an explicit stop state for IPv4LL

Add an explicit stop state for IPv4LL so that the user can stop the
IPv4LL client from the callback. When returning from the callback,
check also the stop state in order to halt any further protocol
processing.

5 years agosd-ipv4ll: Add reference counting for IPv4LL
Patrik Flykt [Wed, 9 Apr 2014 10:12:09 +0000 (13:12 +0300)]
sd-ipv4ll: Add reference counting for IPv4LL

Similar to DHCP, the IPv4LL library user can decide to free the LL
client any time the callback is called. Guard against freeing the
LL client in the callback by introducing proper reference counting.

Also update code using the IPv4LL library to properly handle a
returned NULL from the notify and stop functions if the IPv4LL
client was freed.

5 years agosd-dhcp-client: Add an explicit stop state for the DHCP client
Patrik Flykt [Wed, 9 Apr 2014 10:12:08 +0000 (13:12 +0300)]
sd-dhcp-client: Add an explicit stop state for the DHCP client

Add an explicit stop state for the DHCP client so that the library
user can issue a stop at any time the callback has been called.
When returning from the callback, check also the stop state and
stop any further DHCP processing.

5 years agosd-dhcp-client: Add reference counting for DHCP
Patrik Flykt [Wed, 9 Apr 2014 10:12:07 +0000 (13:12 +0300)]
sd-dhcp-client: Add reference counting for DHCP

The DHCP library user can decide to free the DHCP client any time
the callback is called. After the callback has been called, other
computations may still be needed - the best example being a full
restart of the DHCP procedure in case of lease expiry.

Fix this by introducing proper reference counting. Properly handle
a returned NULL from the notify and stop functions if the DHCP
client was freed.

5 years agosd-dhcp-client: recevie_message - verify cmsg_len before reading
Tom Gundersen [Thu, 10 Apr 2014 22:51:55 +0000 (00:51 +0200)]
sd-dhcp-client: recevie_message - verify cmsg_len before reading

5 years agosd-rtnl: use SO_PASSCRED
Tom Gundersen [Thu, 10 Apr 2014 22:04:39 +0000 (00:04 +0200)]
sd-rtnl: use SO_PASSCRED

This unifies the socket handling with other sd-* libraries.

5 years agobash completion: add -i/--image to nspawn
Thomas Hindoe Paaboel Andersen [Thu, 10 Apr 2014 22:48:19 +0000 (00:48 +0200)]
bash completion: add -i/--image to nspawn

5 years agobus: catch up with kdbus changes (ABI break)
Kay Sievers [Thu, 10 Apr 2014 20:27:23 +0000 (13:27 -0700)]
bus: catch up with kdbus changes (ABI break)

5 years agobus: update kdbus.h
Kay Sievers [Thu, 10 Apr 2014 20:02:35 +0000 (13:02 -0700)]
bus: update kdbus.h

5 years agotimedated: ignore initial delta in history data
Kay Sievers [Thu, 10 Apr 2014 19:58:10 +0000 (12:58 -0700)]
timedated: ignore initial delta in history data

5 years agosd-rtnl: don't drop multi-part messages
Tom Gundersen [Thu, 10 Apr 2014 17:40:48 +0000 (19:40 +0200)]
sd-rtnl: don't drop multi-part messages

We still only return the first message part in callback/synchronous calls.

5 years agosd-rtnl: use GREEDY_REALLOC for message queues
Tom Gundersen [Thu, 10 Apr 2014 17:00:30 +0000 (19:00 +0200)]
sd-rtnl: use GREEDY_REALLOC for message queues

5 years agosd-dhcp-client: test - fix for jenkins
Tom Gundersen [Thu, 10 Apr 2014 14:37:47 +0000 (16:37 +0200)]
sd-dhcp-client: test - fix for jenkins

This test should have been updated when changing the magic cookie handling around.

Reported by Ken MacLeod.