1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

15797 Commits

Author SHA1 Message Date
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
Patrik Flykt
813e3a6ffc sd-dhcp6-client: Add basic DHCPv6 test cases
Add test cases for basic DHCPv6 client handling, e.g. setting
interface index, mac address and attaching event loop.
2014-06-19 15:44:43 +03:00
Patrik Flykt
f12abb48fc sd-dhcp6-client: Add DHCPv6 IAID functionality
Create structures describing Identity Association IDentifiers and
IPv6 lease addresses.

[tomegun: initialize the IAID when client is started. Base this off of the
predictable udev names, if available, as these satisfy the requirement of
the IAID, and base it off the mac addres otherwise, as that is the best we
have.]
2014-06-19 15:44:43 +03:00
Tom Gundersen
fc5414305d network-internal: split out net_get_name() 2014-06-19 15:44:43 +03:00
Tom Gundersen
a276e6d686 sd-dhcp6-client: Initialize DUID
Initialize DHCP Unique Identifier when creating the client. The
DUID is generated based on the machine-id, which satisfies all the
requirements of what an DUID should be. The DUID type is DUID-EN.

Based on patch by Patrik Flykt.
2014-06-19 15:44:43 +03:00
Patrik Flykt
f20a35cc0d sd-icmp6-nd: Add initial Router Advertisement test case
Feed a Router Advertisement to the code and expect proper events
each time. The sending part is ignored, as all of it is static code
in the real dhcp_network_icmp6_send_rs() function.
2014-06-19 15:44:43 +03:00
Patrik Flykt
e316912679 sd-icmp6-nd: Add Router Solicitation and Advertisement support
Provide functions to bind the ICMPv6 socket to the approriate interface
and set multicast sending and receiving according to RFC 3493, section
5.2. and RFC 3542, sections 3. and 3.3. Filter out all ICMPv6 messages
except Router Advertisements for the socket in question according to
RFC 3542, section 3.2.

Send Router Solicitations to the all routers multicast group as
described in RFC 4861, section 6. and act on the received Router
Advertisments according to section 6.3.7.

Implement a similar API for ICMPv6 handling as is done for DHCPv4 and
DHCPv6.
2014-06-19 15:44:43 +03:00
Patrik Flykt
139b011ab8 sd-dhcp6-client: Add initial DHCPv6 client files
Add initial structure definition and functions for setting index, MAC
address, callback and event loop. Define protocol values and states.
2014-06-19 15:44:43 +03:00
Lennart Poettering
61b3b1b8bc build-sys: run forgotten 'make update-man-list' 2014-06-19 13:47:07 +02:00
Lennart Poettering
f4bab1690e coredump: coredumpctl is so useful now, make it a first-class citizen
Drop the "systemd-" prefix, renaming it from "systemd-coredumpctl" to
"coredumpctl".
2014-06-19 13:46:01 +02:00
Lennart Poettering
92788e46d6 update TODO 2014-06-19 12:38:45 +02:00
Lennart Poettering
edc3797f7c journald: make SplitMode=uid the default
Now that we actually can distuingish system and normal users there's no
point in taking session information into account anymore when splitting
up logs.

This has the beenfit with that coredump information will actually end up
in each user's own journal.
2014-06-19 12:38:45 +02:00
Lennart Poettering
9eecdbc354 update TODO 2014-06-19 12:38:45 +02:00
Lennart Poettering
0c51aada56 coredumpctl: introduce new -1 switch for showing a single, most recent entry only
"coredumpctl info -1" is now incredibly useful for showing the most recent
stacktrace.
2014-06-19 12:38:45 +02:00
Lennart Poettering
0cd77f9783 coredump: simplify how we apply extended attributes to coredumps 2014-06-19 12:38:45 +02:00
Lennart Poettering
8d4e028f18 coredump: include stacktrace of coredumps in the log message
elfutils' libdw is maintained, can read DWARF debug data and appears to
be the library of choice for generating backtraces today.
2014-06-19 12:38:45 +02:00
Thomas Hindoe Paaboel Andersen
8271bd16ce bootchart: add assert
since 376cd3b89c LIST_FIND_TAIL accepts
an empty list. That removed an assert in LIST_FIND_TAIL and we now
theoretically risk a null pointer deref. This adds the assert directly
to protect against that.
2014-06-19 00:18:05 +02:00
Lennart Poettering
a035f8191a coredump: add 3 more metadata fields to coredump entries 2014-06-19 00:00:24 +02:00
Lennart Poettering
e15758cce3 coredump: add new "info" verb to coredumpctl showing detailed information about a coredump 2014-06-19 00:00:24 +02:00
Lennart Poettering
a276ae7429 coredump: make sure coredumpctl can handle externally stored coredumps 2014-06-19 00:00:24 +02:00
Lennart Poettering
a45e6ef38f tmpfiles: automatically clean up /var/lib/systemd/coredump after 3d 2014-06-19 00:00:24 +02:00
Lennart Poettering
34c10968cb coredump: optionally store coredumps on disk, not in the journal
Introduce a new configuration file /etc/systemd/coredump.conf to
configure when to place coredumps in the journal and when on disk.

Since the coredumps are quite large, default to storing them only on
disk.
2014-06-19 00:00:24 +02:00
Lennart Poettering
3bdace9bf7 dhcp-server: simplify dhcp server unref call
No need to use HASHMAP_ITERATE when we destruct all entries anyway.
2014-06-19 00:00:24 +02:00
Thomas Hindoe Paaboel Andersen
df9db010de TODO: update 2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen
cee288adf8 socket: check return from exec_spawn 2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen
f7926298e9 sd-dhcp-client: check return from dhcp_option_append 2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen
02557f973a sd-dhcp-server: fix a leak
We must use free instead of dhcp_lease_free here to avoid freeing
client_id.data.
2014-06-18 23:21:00 +02:00
Lennart Poettering
7826397d92 network: automatically assign each container veth link a /28 IP address range 2014-06-18 18:28:29 +02:00
Lennart Poettering
4f43493897 networkd: configure dhcp server range only after successfully setting an IP address on the interface
This way we can make use of the addresses of the IP pool.
2014-06-18 18:28:29 +02:00
Lennart Poettering
11bf3cced1 networkd: add address pool support
When an address is configured to be all zeroes, networkd will now
automatically find a locally unused network of the right size from a
list of pre-configured pools. Currently those pools are 10.0.0.0/8,
172.16.0.0/12, 192.168.0.0/16 and fc00::/7, i.e. the network ranges for
private networks. They are compiled in, but should be configurable
eventually.

This allows applying the same configuration to a large number of
interfaces with each time a different IP range block, and management of
these IP ranges is fully automatic.

When allocating an address range from the pool it is made sure the range
is not used otherwise.
2014-06-18 18:28:29 +02:00
Lennart Poettering
059f6c42b7 networkd: add a number of calls to manipulate in_addr_union structs 2014-06-18 18:28:29 +02:00
Lennart Poettering
5d3de3fe9c socket-util: introduce in_addr_union similar to sockaddr_union and make use of it everywhere 2014-06-18 18:28:29 +02:00
Michal Sekletar
03966da2ca dhcp-network: remove TODO
There is no need to explicitly check version of L3 protocol in the
ethernet header because we bind socket with .sll_protocol set to
ETH_P_IP, thus we only receive IPv4 packets on the socket.
2014-06-18 18:14:51 +02:00
Marcel Holtmann
7cfa80f07e hwdb: Update database of Bluetooth company identifiers 2014-06-18 13:55:32 +02:00
Kay Sievers
8142913690 TODO: update 2014-06-18 03:46:44 +02:00
Kay Sievers
27e7c26268 rules: add loop-control and btrfs-control to "disk" group 2014-06-18 03:37:32 +02:00
Lennart Poettering
9542239eaf cryptsetup: introduce new cryptsetup-pre.traget unit so that services can make sure they are started before and stopped after any LUKS setup
https://bugzilla.redhat.com/show_bug.cgi?id=1097938
2014-06-18 00:09:46 +02:00