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

22284 Commits

Author SHA1 Message Date
Tom Gundersen
4a316c44aa Merge pull request #1055 from poettering/dhcp-updates
Various networkd and dhcp updates
2015-08-27 21:38:36 +02:00
Sylvain Pasche
95a0e12878 hwdb: add DPI data for a few Logitech mice 2015-08-27 21:17:15 +02:00
Lennart Poettering
d56cc29880 update TODO 2015-08-27 21:05:13 +02:00
Lennart Poettering
1fac0c31ab sd-resolve: drop res_query() API
Querying low-level DNS RRs should be done via resolved now, not via
glibc's awful res_query() API anymore. Let's not introduce an async
wrapper for it hence.
2015-08-27 20:47:13 +02:00
Lennart Poettering
c2c940bda0 networkd: s/now/know 2015-08-27 20:23:17 +02:00
Lennart Poettering
e37d2c941f dhcp: say domain name, when we mean domain name 2015-08-27 19:57:11 +02:00
Lennart Poettering
9c8e3101ce network: get rid of more RefCnt usage
A follow-up to 3733eec3e2
2015-08-27 19:56:52 +02:00
Lennart Poettering
86514214e3 dhcp: fix n_ref type
Fixes fallout from 3733eec3e2.
2015-08-27 19:55:29 +02:00
Lennart Poettering
52efd56a63 tree-wide: we place the opening bracket on the same line as the function name
Let's do this everywhere the same way.
2015-08-27 17:48:24 +02:00
Lennart Poettering
2f5b4a774a networkd: make sure we remove udev fd from epoll *before* closing it
Otherwise we'll try to remove an invalid fd from epoll all the time.
2015-08-27 17:38:05 +02:00
Lennart Poettering
ad9437836f man: document the new DHCP settings added in the past commits 2015-08-27 17:34:44 +02:00
David Herrmann
e1439a1472 NEWS: update
Add 'machinectl shell' to NEWS and also update date and contributors
lists.
2015-08-27 17:03:18 +02:00
Lennart Poettering
539f2a7381 networkd: emit DNS/NTP/Timezone info via DHCP server by default
If we have the data, emit it by default.
2015-08-27 16:47:26 +02:00
Lennart Poettering
4f5f911e81 networkd: propagate DNS/NTP server from uplink to dhcp server
When handing out DHCP leases, try to propagate DNS/NTP server
information from "uplink". The "uplink" is automatically determined as
the network interface with the highest priority default route on it.
2015-08-27 16:45:24 +02:00
David Herrmann
154429127c sd-bus: do not connect to dbus-1 socket when kdbus is available
We should not fall back to dbus-1 and connect to the proxy when kdbus
returns an error that indicates that kdbus is running but just does not
accept new connections because of quota limits or something similar.

Based on a patch by Kay.
2015-08-27 16:43:02 +02:00
David Herrmann
057171efc1 Revert "sd-bus: do not connect to dbus-1 socket when kdbus is available"
This reverts commit d4d00020d6. The idea of
the commit is broken and needs to be reworked. We really cannot reduce
the bus-addresses to a single address. We always will have systemd with
native clients and legacy clients at the same time, so we also need both
addresses at the same time.
2015-08-27 16:32:22 +02:00
David Herrmann
8faae625dc selinux: drop mac_selinux_unit_access_check_strv()
It is not acceptable to load unit files during enable/disable operations
just to figure out the selinux labels. systemd implements lazy loading
for units, so the selinux hooks need to follow it.

This drops the mac_selinux_unit_access_check_strv() helper which
implements a non-acceptable policy check. If anyone cares for that
functionality, you really should pass a callback+userdata to the helpers
in src/shared/install.c which does policy checks on each touched file.

See #1050 on github for more.
2015-08-27 16:29:01 +02:00
David Herrmann
19bee5c367 sd-bus: rename bloom-tag to arg0-has
We use dashes in our bloom-tags. Make sure the newly introduced arg0has
tag uses the same style.

Note that the external dbus-tags don't use dashes, though. They are
defined in the spec and we need to keep compatibility there.
2015-08-27 16:29:01 +02:00
David Herrmann
21e654dae9 Merge pull request #1036 from poettering/sd-bus-arg0has
sd-bus: introduce new match type "arg0has=" for matching arrays of st…
2015-08-27 16:14:20 +02:00
David Herrmann
5f92c3ada6 Merge pull request #1024 from poettering/sd-bus-explicit
sd-bus: introduce new SD_BUS_VTABLE_PROPERTY_EXPLICIT flag
2015-08-27 16:12:52 +02:00
Lennart Poettering
1a04db0fc9 dhcp,network: support emitting DNS/NTP server information from DHCP server
For now, this is very simple and IP addresses have to be configured
manually.
2015-08-27 14:48:37 +02:00
Lennart Poettering
fc2f9534d0 networkd: split up networkd.h into per-object header files
No functional changes, just moving definitions into separate header
files.
2015-08-27 14:01:23 +02:00
Lennart Poettering
f6b8196f7c networkd: port many log messages over to newer logging API
Let's drop some strerror() invocations, and make use of the easier to
use newer logging APIs.
2015-08-27 13:04:33 +02:00
Kay Sievers
25568304d2 udev: control - add FIXME comment to remove work-around 2015-08-27 12:57:17 +02:00
Lennart Poettering
f02b961582 sd-bus: it's not a user error to query the error contained in a bus message
It's an OK way to check whether a message contains an erro, let's not
consider this a loggable assertion event.
2015-08-27 12:54:35 +02:00
Lennart Poettering
dce391e78f networkd: properly reset transient hostname when we lose a DHCP lease
Previously we were setting the transient hostname again, rather than
resetting it.
2015-08-27 12:53:43 +02:00
Lennart Poettering
21b80ad126 networkd: optionally push dhcp timezone into timedated 2015-08-27 02:13:59 +02:00
Lennart Poettering
fbcd420aa4 dhcp: don't underflow in lease time calculations
Don't underflow when calculating lease time.
2015-08-27 01:59:43 +02:00
Lennart Poettering
586ac6f711 networkd: make DHCP lease timeouts configurable 2015-08-27 01:47:42 +02:00
Lennart Poettering
39745a5afb networkd: fix indentation 2015-08-27 01:18:10 +02:00
Lennart Poettering
4b7b5abb78 dhcp: NTP servers should be requested by networkd but not implicitly by sd-dhcp
The library so far always requested the NTP servers. This might be
unnecessary in some uses, hence let's move the request into networkd
instead.
2015-08-27 01:17:30 +02:00
Lennart Poettering
0339cd7707 dhcp: clean up dhcp4 lease object
a) drop handling of obsolete or unused DHCP options time_offset,
   mtu_aging_timeout, policy filter, mdr, ttl, ip forwarding settings.
   Should this become useful one day we can readd support for this.

b) For subnet mask and broadcast it is not always clear whether 0 or
   255.255.255.255 might be valid, hence maintain a boolean indicating
   validity next to it.

c) serialize/deserialize broadcast address, lifetime, T1 and T2 together
   with the rest of the fields in dhcp_lease_save() and
   dhcp_lease_load().

d) consistently return ENODATA from getter functions for data that is
   missing in the lease.

e) add missing getter calls for broadcast, lifetime, T1, T2.

f) when decoding DHCP options, generate debug messages on parse
   failures, but try to proceed if possible.

g) Similar, when deserializing a lease in dhcp_lease_load(), make sure
   we deal nicely with unparsable fields, to provide upgrade compat.

h) fix some memory allocations
2015-08-27 01:05:13 +02:00
Lennart Poettering
b3ec603ce8 dhcp: rename index to ifindex
This avoids confusion what this is, in particular as libc knows an
index() function.
2015-08-26 23:31:49 +02:00
Lennart Poettering
9a0f246fcd dhcp: store client id as void*, since we dont know what it is 2015-08-26 23:30:27 +02:00
Lennart Poettering
966d74c043 dhcp: properly handle error from ioctl() 2015-08-26 23:26:01 +02:00
Lennart Poettering
e473522841 dhcp: generic data should be void*, not uint8_t*
If we handly arbitrary data we should use "void*" pointers, not
"uint8_t*", how go intended C to be used.
2015-08-26 23:05:34 +02:00
Lennart Poettering
89ca10c6a6 network: s/user_data/userdata/
Everywhere else we call the generic user data pointer just "userdata",
rather than "user_data". Let's do this here, too.
2015-08-26 22:47:53 +02:00
Lennart Poettering
0ae0e5cd96 dhcp: coding style fixes
We place the opening bracket of a function on the same line as the
function name. Let's do so in the DHCP sources too.
2015-08-26 21:09:00 +02:00
Lennart Poettering
3733eec3e2 dhcp: stop using refcnt.h
No need to invole atomic ops in single-threaded APIs, let's simplify
this.
2015-08-26 21:05:53 +02:00
Lennart Poettering
57de20dd8f basic: document that people shouldn't use refcnt.h without reason
refcnt.h only exists for cases where objects are simultaneously handled
by different threads. Otherwise it should not be used. The only case
where this applies is sd_bus, really, and pretty much none of our APIs,
since we do not claim thread-safety for them.
2015-08-26 21:04:38 +02:00
Lennart Poettering
bd91b83e57 dhcp: keep lease save/load functions private
When we make sd-dhcp public one day we really should not make
sd_dhcp_lease_save() and sd_dhcp_lease_load() public, since it's pretty
much only useful as internal utility for networkd itself.
2015-08-26 20:48:21 +02:00
Lennart Poettering
2f3cf1f9e1 networkd: let's uppercase the first character in log messages
Let's try to generate log messages that resemble english language
sentences, hence uppercase the first character.
2015-08-26 20:45:29 +02:00
Lennart Poettering
9098162579 dhcp: normalize DHCP host and domain names from leases
Previoulsy, we just checked whether the domain names specified in
incoming DHCP leases are valid. Given that validation code actually
internally normalizes anyway, it's a good idea to simply do the full
normalization and store that in the lease structure. This allows us to
remove the manual removal of a trailing dot, if there is one.
2015-08-26 20:45:29 +02:00
Lennart Poettering
2d03c0b803 dhcp: various simplifications 2015-08-26 20:45:29 +02:00
Lennart Poettering
e26b50585b network: turn on DHCP timezone passing between container and host
Let's turn on DHCP timezone passing from the host to a container, so
that the timezone is always in sync.
2015-08-26 20:45:29 +02:00
Lennart Poettering
8eb9058dc1 dhcp,network: implement RFC 4833 (DHCP Timezone option)
This one is simply to add: encode the tzdata timezone in the DHCP
options and optionally make use of it.
2015-08-26 20:44:20 +02:00
Lennart Poettering
43f447b121 dhcp: be more careful when parsing strings from DHCP packets
Let's make sure there's no embedded 0 byte. Also, let's reset the string
if the length is zero.
2015-08-26 20:41:42 +02:00
Lennart Poettering
1ac608c9cc networkd: don't leak memory of Hostname= is used twice in a .network file
Also, we should only accept trailing dots where we have to, but not
everywhere, hence be more strict when validating configured hostnames.
2015-08-26 20:41:22 +02:00
Lennart Poettering
5c904ba5a5 time-util: add new get_timezone() call to get local timezone
Let's move the timedated-specific code to time-util.h and make it
generic.
2015-08-26 20:36:42 +02:00
Kay Sievers
fd5a461316 hwdb: update 2015-08-26 18:38:30 +02:00