1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00
Commit Graph

15733 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
dede0e335d util.c: simplify rm_rf_children_dangerous 2014-06-19 20:08:44 -04:00
Ronny Chevalier
4a336a69fd tests: add tests for strv_extendf 2014-06-19 19:59:57 -04:00
Ronny Chevalier
927be00cb3 tests: add tests to test-util
add tests for:
  - filename_is_safe
  - ascii_strlower
  - files_same
  - is_valid_documentation_url
  - file_in_same_dir
  - endswith
  - close_nointr
  - unlink_noerrno
  - readlink_and_make_absolute
  - read_one_char
  - ignore_signals
  - strshorten
2014-06-19 19:59:57 -04:00
Ronny Chevalier
4630bbb766 tests: add missing return 2014-06-19 19:59:57 -04:00
Ronny Chevalier
f277be6768 tests: fix test-icmp6-rs
Don't close the fd given to sd-icmp6-nd, since it will be aynschonously closed
by sd_icmp6_nd_unref
2014-06-20 00:32:02 +02:00
Ronny Chevalier
03de7ed905 sd-icmp6-nd: fix uninitialized fd 2014-06-20 00:27:38 +02:00
Ronny Chevalier
513a6fa867 sd-dhcp6-client: fix uninitialized variables 2014-06-20 00:26:54 +02:00
Filipe Brandenburger
cacd6403a0 coredump: fix include of xattr.h
The correct path is now <sys/xattr.h> (from glibc-headers) and no longer
<attr/xattr.h> (from libattr-devel.)

Fixes: 34c10968cb
2014-06-20 00:26:03 +02:00
Filipe Brandenburger
228b2a1277 sd-dhcp6-client: include dhcp6-protocol.h in the list of sources
If the file is not listed, then "make dist" will not include it.

Tested: "make distcheck" works after this fix is applied.

Fixes: 139b011ab8
2014-06-20 00:25:08 +02:00
Filipe Brandenburger
ab2bc6feee sd-dhcp6-client: fix path of sd-icmp6-nd.h in Makefile.am
It was incorrectly looking for a file in src/libsystemd-network/ when the file was actually deployed to src/systemd/ instead.  This broke "make dist".

Tested: "make dist" works again after this patchset is applied.

Fixes: f20a35cc0d
2014-06-20 00:25:04 +02:00
Filipe Brandenburger
302c9d6c8b sd-dhcp6-client: remove bogus dependency on dhcp6-icmp6.h
Makefile.am had a reference to it but it none of the sources included it.

Tested: "make dist" works again after this patchset is applied.

Fixes: 2ea8857eff
2014-06-20 00:25:00 +02:00
Lennart Poettering
2c455af4c7 copy: don't eat up error from chown()/chmod()
The idea was to not fail on, nor to ignore errors from chown()/chmod(),
but to proceed and simply return the most recent error...
2014-06-20 00:20:35 +02:00
Lennart Poettering
497d1986c1 units: order systemd-tmpfiles-clean.service after time-sync.target
That way, on systems lacking an RTC we don't false start removing aged
files too early.
2014-06-20 00:15:39 +02:00
Steven Noonan
ae94176262 networkd: fix refcounting with UseMTU=yes
The link was unintentionally being unreferenced instead of referenced for the
MTU setup.
2014-06-19 20:40:20 +02:00
Lennart Poettering
a55954297d units: add missing caps so that GetAddresses() can work 2014-06-19 19:53:16 +02:00
Lennart Poettering
e156347e04 tmpfiles: make sure "C" doesn't copy anything if the destination already exists
Previously it would recursively copy the entire tree in, and descend
into subdirectories even if the destination already exists. Let's do
what the documentation says and not do that.

If files down the tree shall be copied too, they should get their own
"C" lines.
2014-06-19 19:36:08 +02:00
Kay Sievers
19f3934057 tmpfiles: do not fail when copying an empty directory 2014-06-19 18:58:17 +02:00
Lennart Poettering
eca8701ae7 man: document new coredumpctl commands 2014-06-19 17:36:39 +02:00
Lennart Poettering
31a020ced3 coredumpctl: add missing entries to --help 2014-06-19 17:36:22 +02:00
Lennart Poettering
c3f841063d coredumpctl: fix columns sizing for timestamp 2014-06-19 17:29:39 +02:00
Lennart Poettering
1a524ed4ad build-sys: add missing Makefile symlink 2014-06-19 17:13:44 +02:00
Lennart Poettering
5a0e3f28ad net: enable dhcp6 for containers 2014-06-19 17:09:05 +02:00
Lennart Poettering
f685b70279 man: add documentation for systemd-debug-generator 2014-06-19 17:06:35 +02:00
Lennart Poettering
d34f1a4280 gitignore: hide dhcp6/icmp6-rs tests 2014-06-19 16:57:10 +02:00
Lennart Poettering
8501384436 stop complaining about unknown kernel cmdline options
Also stop warning about unknown kernel cmdline options in the various
tools, not just in PID 1
2014-06-19 16:55:20 +02:00
Lennart Poettering
52c611b776 man: add new kernel command line switches to kernel-command-line(7) 2014-06-19 16:54:40 +02:00
Lennart Poettering
d2f42e3a9b update TODO 2014-06-19 16:33:01 +02:00
Lennart Poettering
9e01adfa90 main: don't show help text anymore when we detect an unknown kernel cmdline value starting with "systemd."
As generators and other components started to maintain their own kernel
command line options this help text needed more and more exceptions and
wasn't complete anyway. Fixing that would leak more information about
specific generators into PID 1, which we should avoid.

Given that kernel cmdline handling traditionally doesn't generate errors
or show help texts, let's just remove the logic for it for systemd too.
2014-06-19 16:33:01 +02:00
Lennart Poettering
ca05941b9a main: honour rd.systemd.unit= only in the initrd, not the host 2014-06-19 16:33:01 +02:00
Lennart Poettering
e34eee2c4f gitignore: sort properly 2014-06-19 16:33:01 +02:00
Lennart Poettering
326bb68c40 debug-generator: add new generator
debug-generator can mask specific units if they are specified on the
kernel command line with systemd.mask=.

debug-generator can pull in debug-shell.service is systemd.debug-shell
is passed on the kernel command line.
2014-06-19 16:33:01 +02:00
Zbigniew Jędrzejewski-Szmek
c806ffb959 sd-dhcp6-client: Initialize fd to -1 and rename function
client_initialize name is misleading, since the function is actually
useful at the *end*, to reinitialize the object. But reset is shorter,
so rename it to client_reset.
2014-06-19 09:09:56 -04:00
Ronny Chevalier
08d555f347 man: fix typo 2014-06-19 08:53:31 -04:00
Zbigniew Jędrzejewski-Szmek
61c024b328 journal-send.c: use automatic cleanup 2014-06-19 08:53:31 -04:00
Patrik Flykt
4138fb2c79 networkd: Add initial DHCPv6 support
Enable DHCPv6 support by creating a DHCPv6 boolean in the Network
section. Add necessary DHCPv6 structures and initial function calls.
2014-06-19 15:44:44 +03:00
Patrik Flykt
947527f832 sd-dhcp6-client: Add reply sending for test
Enhance the test case by generating a Reply. With a properly formed
Reply the callback function will be called and the additional
earlier event loop exit can now be removed.
2014-06-19 15:44:44 +03:00
Patrik Flykt
a34b57c0d4 sd-dhcp6-client: Receive and parse a reply and set T1 and T2 timers
Receive and parse a Reply from the server. Set up T1 and T2 timers and
notify the library user of an acquired DHCPv6 lease.
2014-06-19 15:44:44 +03:00
Patrik Flykt
5e256ea7d3 sd-dhcp6-client: Add Advertise sending for test case
Enhance the test case by replying with an Advertise message to the
client. Copy the transaction id, IAID and DUID from the Solicit
message. Verify the Request message created by the DHCPv6 client
implementation and move the main loop exit to the end of the Request
message verification.
2014-06-19 15:44:44 +03:00
Patrik Flykt
7246333cb8 sd-dhcp6-client: Add Request message sending
As described in RFC 3315, Section 17.1.2, a client has to wait until the
first timeout has elapsed before it is allowed to request IPv6 addresses
from the DHCPv6 server. This is indicated by a non-NULL lease and a
non-zero resend count. Should the Advertisement contain a preference
value of 255 or be received after the first timeout, IPv6 address
requesting is started immediately.

In response to these events, create a Request message and set up proper
resend timers to send the message to the server.
2014-06-19 15:44:44 +03:00
Patrik Flykt
c3e2adeaba sd-dhcp6-client: Update start function to take a state
Update the start function so that the client state can be conveniently
changed with the previous message resend timers cleared. On initial
startup also create and bind to the UDP socket.
2014-06-19 15:44:44 +03:00
Patrik Flykt
859cca44f8 sd-dhcp6-client: Add test case for Advertise message parsing
Add a basic test case excersising once more option parsing function
in addition to lease handling. Check that the address iteration
functions return the correct IPv6 address and lifetimes and that
only one address is returned. Also verify that the server ID and
preference values are read correctly.
2014-06-19 15:44:44 +03:00
Patrik Flykt
ea3b3a75ab sd-dhcp6-lease: Add functions for accessing lease and addresses
Add support functions for accessing the current client lease as well
as iterating over the addresses and get their preferred and valid
lifetimes.
2014-06-19 15:44:44 +03:00
Patrik Flykt
631bbe7129 sd-dhcp6-client: Receive and parse Advertise messages
When receiving DHCPv6 messages, discard the ones that are not meant
for DHCPv6 clients and verify the transaction id. Once that is done,
process the Advertise message and select the Advertise with the
highest preference.

Create a separate function for lease information parsing so that it
can be reused in other parts of the protocol. Verify both DUID and
IAID in the received message and store other necessary information
with the lease structure.
2014-06-19 15:44:44 +03:00
Patrik Flykt
c6affce874 sd-dhcp6-client: Add IA Address option parsing
Add functionality to parse DHCPv6 Identity Association for
Non-temporary (IA_NA) and Temporary Addresses (IA_TA) options.
Both of them contain one or more IA Address (IAADDR) options
and optinally a status code option. Only the IA_NA option
contains lease lifetimes. See RFC 3315, sections 22.4., 22.5.,
22.6., 22.13. and appendix B. for details. If the lease
timeouts are not set, use the ones recommended for servers in
section 22.4.

Factor out common code in the form of an option header parsing
helper function.
2014-06-19 15:44:44 +03:00
Patrik Flykt
3fb2c57038 sd-dhcp6-lease: Add DHCPv6 lease handling
Create a structure describing a DHCPv6 lease. Add internal functions
for creating a new lease and accessing the server ID, preference and
IAID. Provide functions for clearing addresses and associated timers.

External users are initially given only the capabilities of
referencing and unreferencing the lease structure.
2014-06-19 15:44:44 +03:00
Patrik Flykt
2ea8857eff sd-dhcp6-client: Add DHCPv6 Solicit test case
Verify the Solicit message created by the DHCPv6 client code.

Provide local variants for detect_vm(), detect_container() and
detect_virtualization() defined in virt.h. This makes the DHCPv6
library believe it is run in a container and does not try to request
interface information from udev for the non-existing interface index
used by the test case code.
2014-06-19 15:44:44 +03:00
Patrik Flykt
a9aff3615b sd-dhcp6-client: Add DHCPv6 Solicit message creation and sending
Implement the initial functionality used for creating a DHCPv6 Solicit
message containing the needed options and send it to the DHCPv6
broadcast address. Increase the sent message count and ensure that
the Solicit Initial Retransmission Time is strictly greater than
the Solicitation IRT as described in RFC 3315, section 17.1.2.
2014-06-19 15:44:44 +03:00
Patrik Flykt
34e8c5a23c sd-dhcp6-client: Add functions to bind to DHCPv6 UDP socket
Add a function that creates a UDP socket bound to the given interface
and optionally to an IPv6 address. Add another function that will
send the DHCPv6 UDP packet to its destination.

Using IPV6_PKTINFO in setsockopt to bind the IPv6 socket to an
interface is documented in section 4. of RFC 3542, "Advanced Sockets
Application Program Interface (API) for IPv6"

Add a define for DHCPv6 Relay Agents and Servers multicast address as
its not available elsewhere.
2014-06-19 15:44:44 +03:00
Patrik Flykt
f12ed3bf0b sd-dhcp6-client: Add basic DHCPv6 option handling
Add option appending and parsing. DHCPv6 options are not aligned, thus
the option handling code must be able to handle options starting at
any byte boundary.

Add a test case for the basic option handling.
2014-06-19 15:44:43 +03:00
Patrik Flykt
d1b0afe365 sd-dhcp6-client: Add DHCPv6 client Solicitation timeout handling
Add the core of DHCPv6 client message retransmission and upper bound
timer and message count handling according to RFC 3315 Secions 7.1.2
and 14. Omit the DHCPv6 initial delay; for now it is assumed that
systemd-networkd will provide decent startup randomization that will
desynchronize the clients.

When reinitializing the client, clear all timers.
2014-06-19 15:44:43 +03:00