Commit graph

14913 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek e3b9d9c802 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.
2014-04-12 10:20:55 -04:00
Zbigniew Jędrzejewski-Szmek 6e00a80641 test-dhcp-client: unref lease objects to make valgrind happy
Also unref client objects in test code, and initalize logging,
to DEBUG by default.
2014-04-12 10:20:55 -04:00
Zbigniew Jędrzejewski-Szmek ca2d378414 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.
2014-04-12 10:20:55 -04:00
Tom Gundersen 7cc832b91e 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.
2014-04-12 12:48:12 +02:00
Tom Gundersen ffba61663a 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.
2014-04-12 12:06:28 +02:00
Tom Gundersen 730b306208 sd-dhcp-client: drop logging about T1/T2
These are redundant now that the REQUEST messages contain the same information.
2014-04-12 11:20:28 +02:00
Tom Gundersen 998d804702 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.
2014-04-12 01:01:13 +02:00
Tom Gundersen 7739a40b45 sd-dhcp-client: use client_initialiez and client_restart for REBOOT 2014-04-12 00:34:05 +02:00
Tom Gundersen 702807365e 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>.
2014-04-11 23:57:18 +02:00
Tom Gundersen 50d6810ea8 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.
2014-04-11 22:24:26 +02:00
Tom Gundersen 8a9e761600 sd-dhcp-client: assert that we can only create DISCOVER or REQUEST messages 2014-04-11 22:24:25 +02:00
Tom Gundersen eb105b96d5 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.
2014-04-11 18:02:54 +02:00
Patrik Flykt 4d978a4669 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.
2014-04-11 10:54:12 +03:00
Patrik Flykt 56cd007ab8 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.
2014-04-11 10:53:52 +03:00
Patrik Flykt 781ca7a13f 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.
2014-04-11 10:53:34 +03:00
Patrik Flykt e5b04c8de8 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.
2014-04-11 10:53:10 +03:00
Tom Gundersen 48a4612e6b sd-dhcp-client: recevie_message - verify cmsg_len before reading 2014-04-11 00:52:23 +02:00
Tom Gundersen bc078e7163 sd-rtnl: use SO_PASSCRED
This unifies the socket handling with other sd-* libraries.
2014-04-11 00:52:23 +02:00
Thomas Hindoe Paaboel Andersen 5ba85788ab bash completion: add -i/--image to nspawn 2014-04-11 00:49:05 +02:00
Kay Sievers 862bbf89c6 bus: catch up with kdbus changes (ABI break) 2014-04-10 13:27:23 -07:00
Kay Sievers dec51b29f9 bus: update kdbus.h 2014-04-10 13:02:35 -07:00
Kay Sievers d8c21348df timedated: ignore initial delta in history data 2014-04-10 12:58:10 -07:00
Tom Gundersen 1b89cf5648 sd-rtnl: don't drop multi-part messages
We still only return the first message part in callback/synchronous calls.
2014-04-10 19:40:48 +02:00
Tom Gundersen 77768cbabc sd-rtnl: use GREEDY_REALLOC for message queues 2014-04-10 19:00:36 +02:00
Tom Gundersen d47e1de40e sd-dhcp-client: test - fix for jenkins
This test should have been updated when changing the magic cookie handling around.

Reported by Ken MacLeod.
2014-04-10 17:08:32 +02:00
Philip Lorenz 70f539ca14 nspawn: Fix erroneous OOM when building group list
change_uid_gid() never initialises sz which may cause greedy_realloc to
skip the initial buffer allocation.
2014-04-10 09:50:39 -04:00
Lukas Nykryn 13be49798c cgls: fix running with -M option
systemd-machined doesn't store cgroup path in a state file anymore.
Let's figure it out from the scope.
2014-04-10 11:46:51 +02:00
David Herrmann 9541666b8d login: add 'mir' to the list of session types
Add Mir to the list of session types. This is implemented for LightDM
in lp:~robert-ancell/lightdm/xdg-session-desktop [1].

[1] https://code.launchpad.net/~robert-ancell/lightdm/xdg-session-desktop/+merge/214108

(david: adjusted commit-header and fixed whitespace issues)
2014-04-09 21:22:48 +02:00
Mike Gilbert 13468826f2 Document CONFIG_NET_NS as a required kernel option
Several units now utilize the PrivateNetwork parameter, which requires
network namespace support.
2014-04-09 11:21:16 +02:00
Tom Gundersen 7ff8f4b53c networkd: guard against NULL pointers
This should never be a problem, but better be safe than sorry.
2014-04-08 21:26:19 +02:00
Tom Gundersen aa6fc9b8c8 sd-dhcp-client: include client id in debug messages 2014-04-08 19:16:30 +02:00
Zbigniew Jędrzejewski-Szmek de41590a9b man: reword Persistent= description
I think it is easier to grok this way.
2014-04-07 21:02:47 -04:00
Zbigniew Jędrzejewski-Szmek c4acff1275 test-dhcp-client: style fixes 2014-04-07 21:02:47 -04:00
Zbigniew Jędrzejewski-Szmek 938d2699d2 backlight: unify error messages 2014-04-07 21:02:33 -04:00
Tom Gundersen d576127429 libsystemd-network: Speed up checksum computation using 64 bit integers
Improve the checksum computation by using 64 bit integers instead of the 16 bit
integers in the existing implementation. This change speeds up the computation
with approximately 78% both on 64 bit and 32 bit systems.

Please see RFC 1071 for details.
2014-04-07 15:39:21 +03:00
Tom Gundersen 298f77c60c ipv4ll: use BPF on raw socket
This should significantly reduce spurious wakeups.
2014-04-07 09:24:18 +02:00
Tom Gundersen 463b73e24e sd-ipv4ll: fix packet broadcasting
Umut said: 'I have noticed a bug that we are sending PROBE/ANNOUNCE messages on
00:00:00:00:00:00 address where it should be broadcast.'
2014-04-07 09:13:02 +02:00
Tom Gundersen 7429b07f82 sd-dhcp-client: improve BPF
Try a bit harder to make the kernel drop packets not for us. This should reduce
the number of wakeups from n^2 to n in the number of dhcp clients, which admittedly
only makes a differenc in very extreme cases.
2014-04-06 19:42:11 +02:00
Tom Gundersen 0c79c68d93 sd-dhcp-client: eagerly drop too small packets
If they are too small to fit the IP+UDP+DHCP headers they can be of no use, so
don't waste resources parsing them. This is at the cost of losing some verbosity
in the logging.
2014-04-06 19:42:11 +02:00
Tom Gundersen 3b7ca119fd sd-dhcp-client: move magic cookie into DHCPMessage struct
Also move the checking of it to the main message handler, rather than the
options parser.

Fix a bug, so we now drop the packet if any of the magic bytes don't match.
Before we used to only drop the packet if they were all wrong.
2014-04-06 19:36:05 +02:00
Tom Gundersen 19aa72f74e udev: net_id - use constants rather than magic numbers 2014-04-06 18:00:40 +02:00
Thomas Hindoe Paaboel Andersen 609211792b journal-remote-parse: avoid passing null to memchr
Found with scan-build
2014-04-06 11:55:20 +02:00
Kay Sievers b2103dccb3 reduce the amount of messages logged to /dev/kmsg when "debug" is specified 2014-04-06 00:10:18 -04:00
Zbigniew Jędrzejewski-Szmek b65f24238b systemd-python: fix failing assert
A parameter which was always null before, now get's set to
the module.
2014-04-05 13:30:08 -04:00
Zbigniew Jędrzejewski-Szmek b532cf3722 systemd-python: use .hex instead of .get_hex()
It turns out the latter got removed in Python 3.

https://bugs.freedesktop.org/show_bug.cgi?id=77086
2014-04-05 13:30:07 -04:00
Zbigniew Jędrzejewski-Szmek 0830ba6189 build-sys: add newly used if_link.h defines to missing.h
Reported-by: Arnaud Gaboury <arnaud.gaboury@gmail.com>
2014-04-05 13:18:36 -04:00
Zbigniew Jędrzejewski-Szmek ecb08ec6a5 Fix a few return codes in error paths 2014-04-05 00:55:19 -04:00
Florian Albrechtskirchinger ee0e4cca5a tty-ask-password-agent: return negative errno
Return negative errno in wall_tty_block(). get_ctty_devnr() already
returns a negative errno in case of failure, no need to negate it again.

Reported-by: Simon <hwold@odai.homelinux.net>
2014-04-05 00:55:19 -04:00
Zbigniew Jędrzejewski-Szmek b3ae710c25 systemctl: update NAME to PATTERN in help()
Previously the man page was modified, but not help().
2014-04-05 00:42:10 -04:00
Zbigniew Jędrzejewski-Szmek a08ac7e0f7 logind: remove one cast 2014-04-05 00:42:10 -04:00