Commit graph

14885 commits

Author SHA1 Message Date
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
Zbigniew Jędrzejewski-Szmek 0ade5ffe27 journal: fix export of messages containing newlines
In "export" format, newlines are significant, and messages containing
newlines must be exported as "binary".
2014-04-05 00:42:01 -04:00
Zbigniew Jędrzejewski-Szmek a36b8debe6 journalctl: free arg_file on exit 2014-04-05 00:41:35 -04:00
Thomas Bächler 3cadce7d33 backlight: do nothing if max_brightness is 0
On virtually any newer Asus mainboard, the eeepc-wmi driver is loaded.
It exposes a backlight device despite the lack of any physical backlight
devices. This fake backlight device has max_brightness set to 0. Since
the introduction of the clamp_brightness function, systemd-backlight
tries to write '1' to brightness and fails.

This patch changes systemd-backlight to exit gracefully when
max_brightness is 0 before performing any action. This affects
both the load and save actions.
2014-04-04 15:14:12 +02:00
Kay Sievers 51e430a5b0 bash_completion: busctl - add support for --user mode 2014-04-04 08:24:22 -04:00
Thomas Hindoe Paaboel Andersen 085ebc1b22 bash completion: Add -r/--recursive to systemctl 2014-04-03 22:54:41 +02:00
Tom Gundersen 60a0d61e7d network: default to IPv4LL on host0
Now that we have a graceful handover from IPv4LL to DHCP, there is no longer any reason to leave this off by default.
2014-04-03 19:09:22 +02:00
Susant Sahani 0a827d105d sd-rtnl: fix broken test cases and add support for tunnel
This patch fixes the broken test-cases for sd-rtnl and add support for ipip
and sit tunnel.

[tomegun: minor fixups]
2014-04-03 18:09:24 +02:00
Umut Tezduyar Lindskog aba496a58a networkd: smooth transition from ipv4ll to dhcp address
Currently when both ipv4ll and dhcp are enabled, ipv4ll
address (if one has been claimed) is removed when dhcp
address is aquired. This is not the best thing to do
since there might be clients unaware of the removal
trying to communicate.

This patch provides a smooth transition between ipv4ll
and dhcp. If ipv4ll address was claimed [1] before dhcp,
address is marked as deprecated. Deprecated address is still
a valid address and packets can be received on it but address
cannot be selected as a source address. If dhcp lease cannot
be extended, then ipv4ll address is marked as valid again.

[1] If there is no collision, claiming IPv4LL takes between 4 to
7 seconds.
2014-04-03 16:00:25 +02:00
Umut Tezduyar Lindskog 3e790eae01 networkd: drop routes when lease expires 2014-04-03 16:00:19 +02:00
David Herrmann 8016b90484 logind: don't print error if devices vanish during ACL-init
If a device is unplugged while we initialize it, we will get ENOENT for
ACL-init (and related stuff). We currently print errors then, which is
misleading. Print a debug-message early and continue.
2014-04-02 16:25:40 +02:00
Kay Sievers ca2bb1606a udev: do not export "static node" tags for non-existing devices 2014-04-02 15:47:09 +02:00
Tom Gundersen bc29e507e2 sd-dhcp-client: use BPF on raw socket
Filter out everything except UDP packets destined for the DHCP client port,
this should avoid the vast majority of spurious wakeups.

Filter based on [0], with permission.

Possible improvemnts: also check for the DHCP magic cookie to drop invalid
packets. Check for our xid to filter out packets destined for other clients.

[0]: <https://github.com/ambrop72/badvpn/blob/master/dhcpclient/BDHCPClient.c#L57>
2014-04-02 14:49:51 +02:00
Kay Sievers b6b20d1d36 build-sys: remove no longer needed user/org.freedesktop.DBus.busname 2014-04-02 11:34:59 +02:00
Thomas Hindoe Paaboel Andersen 5985ea4d17 build-sys: no use for compat libs in the static analysis 2014-04-01 22:32:44 +02:00
Tom Gundersen bcf3ce7b39 sd-ipv4ll: speed up bind() in the same way as for dhcp 2014-04-01 21:29:56 +02:00
Daniel Buch 0ef298ab47 build-sys: workaround scan-build bug to fix ./autogen.sh s
It seems to be a clang-analyzer problem since it don't behave like
clang-compiler regarding -std={c99,gnu99}
2014-04-01 20:57:14 +02:00
Tom Gundersen 66a67effcc sd-dhcp-client: --omg-optimized
Passing the protocol to socket() is redundant as it will be specified again in
bind(). Dropping the redundancy reduces the cost of bind() from ~30ms to ~0ms.
For details see [0].

networkd in a container (i.e., with next to no network latency) can now
negotiate a DHCP lease in 0.7 - 5 ms.

Thanks to Kay for help with debugging and to Daniel Borkmann for the pointer
to fix the problem.

[0]: <https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=902fefb82ef72a50c78cb4a20cc954b037a98d1c>
2014-04-01 00:32:51 +02:00
Tom Gundersen 208612034e networkd: rewind rtnl message between passing it to functions
This makes updating link status on netdev links work again.
2014-03-31 17:17:56 +02:00
Tom Gundersen 689703f618 sd-rtnl: modernize a bit 2014-03-31 14:43:34 +02:00
Lukasz Skalski 5fa4ddb88c doc: fix items' names in PORTING-DBUS1 2014-03-31 14:23:49 +02:00
Tom Gundersen c589a0e628 TODO 2014-03-31 11:30:59 +02:00
Tom Gundersen fd88eb8ab0 networkd: link - fix memory leak 2014-03-31 10:04:32 +02:00
Tom Gundersen 2292547af9 networkd: fix use-after-free
Free networks before links (the reverse of creation order).
2014-03-31 10:01:59 +02:00
Steven Siloti c8a7165f58 sd-rtnl: fix off-by-one
Also fix type parameter passed to new0
2014-03-31 09:54:37 +02:00
Kay Sievers 42742bf1ce timedated: adjust accuracy and slew values 2014-03-31 04:09:39 +02:00
Tom Gundersen 2ad7561f9f sd-dhcp: avoid checksum calculation if possible
When receiving lots of packets that are not meant for us, we waste a relatively large amount
of cpu time computing their checksums before discarding them. Move the checksum calculation last
so we never compute it for packets which would otherwise be discarded.
2014-03-30 20:46:40 +02:00
Tom Gundersen 6e34949d72 sd-dhcp: check for ipv4 packets 2014-03-30 20:46:40 +02:00
Umut Tezduyar Lindskog d454a6748c sd-dhcp: check for udp packets
Do not try to parse ICMP packets

[tomegun: slightly tweaked debug message]
2014-03-30 20:46:20 +02:00