Commit graph

8633 commits

Author SHA1 Message Date
Tom Gundersen 212bbb1798 sd-event: do not arm timers unnecessarily
Rather than recalculating the next timeout on every loop, we only do it when something changed.
2014-08-14 01:29:51 +02:00
Lennart Poettering e92da1e5d0 networkctl: also use the same color logic when running "networkctl status" without arguments 2014-08-14 01:23:20 +02:00
Lennart Poettering d57c365bf8 networkctl: add the same color logic to "list" and "status" outputs
And always put operational state first, setup state second.
2014-08-14 01:18:37 +02:00
Lennart Poettering ab1525bc2d networkctl: name setup state variable setup_state 2014-08-14 01:10:08 +02:00
Lennart Poettering 2368512a31 networkctl: update column header to new 'setup' state naming 2014-08-14 01:08:46 +02:00
Lennart Poettering db97a66aa6 resolved: enable LLMNR
THis was accidentally broken, as we truned off LLMNR far to frequently,
where we only wanted to turn off LLMNr on IPV6 on kernels lacking
support for it.
2014-08-14 01:01:43 +02:00
Lennart Poettering 51323288fc resolved: allow passing on which protocol, family and interface to look something up
Also, return on which protocol/family/interface we found something.
2014-08-14 01:01:43 +02:00
Tom Gundersen 438ca2bbd4 sd-networkd: rename link_get_state to link_get_setup_state
Suggested by Kay and Lennart.
2014-08-13 22:55:49 +02:00
Tom Gundersen d3df0e3982 sd-network: rename operstates 'down' -> 'off' and 'up' -> 'no-carrier'
Suggested by Lennart and Kay.
2014-08-13 22:44:41 +02:00
Tom Gundersen d6731e4c79 sd-network: /_get_link_/_link_get_/
The link is the 'object', so make this in line with our usual naming convention.

Suggested by Kay and Lennart.
2014-08-13 22:37:45 +02:00
Daniel Buch 5323ead145 networkctl: color status dump without link name
Lets mimic colored operational state dump as if link name is appiled
2014-08-13 22:31:03 +02:00
Lennart Poettering c572db3ccf timesyncd: don't trip up if networkd isn't running and can't tell us any NTP servers 2014-08-13 21:07:07 +02:00
Eelco Dolstra b9c488f600 journald: Fix off-by-one error in "Missed X kernel messages" warning
On receiving a message, "kernel_seqnum" is set to "serial + 1". So
subtracting 1 will cause messages like "Missed 0 kernel messages",
which should be "Missed 1 kernel messages".
2014-08-13 20:50:47 +02:00
Lennart Poettering 48776bdacd sd-network: bring comments up-to-date 2014-08-13 20:02:38 +02:00
Lennart Poettering 7c96ab1d24 mount-setup: fix counting of early mounts without SMACK
http://lists.freedesktop.org/archives/systemd-devel/2014-August/021772.html
2014-08-13 20:01:21 +02:00
Harald Hoyer 5caeb7d685 switch-root: not only mkdir the parents but the target dir
switch-root would only mkdir the parents of the mount move directories.

With this patch, the mount move target directory is created to make
switch-root to an empty root directory work.
2014-08-13 16:45:53 +02:00
Denis Kenzior 587f21d8c0 bus-bloom: Fix bloom filter calculation
i is being used incorrectly.  It is used to refer to the number of
indexes calculated so far (out of k).  However, it is also incremented
when a new hash key is being used.  This means that the results are
inconsistent with the desired behavior described in PORTING-DBUS1
document.

The expected result is that for the default values of m and k (512, 8)
the 1st hash key should produce 4 indexes.  The second hash key is used
for the next 4 and overall 8 indexes into m are calculated.

The current behavior results in 6 indexes being calculated, 4 coming
from hash key 1 and 2 others from hash key 5.
2014-08-13 16:24:59 +02:00
Tom Gundersen 636db02d54 networkctl: add colors to admin state and fix alignment
It is useful to color in the admin state both to easily spot failed links, but also to quickly
distinguish between links that are fully configured and in degraded mode (only IPv4LL) or in
degraded mode and still waiting for DHCP.
2014-08-13 15:39:57 +02:00
Tom Gundersen 8434fd5cf2 sd-network: rename state INITALIZING to PENDING and expose as any other state
This is the state when we are waiting for udev to initialize the device, and waiting for
libudev and rtnl to be in sync. In the future we probably will also be waiting for nl80211.
At this point we do not yet have enough information to know whether or not networkd should
be handling the device.
2014-08-13 15:39:57 +02:00
Lennart Poettering 90ab504273 resolved: skip IPv6 LLMNR if IPv6 is not available 2014-08-13 15:00:12 +02:00
David Herrmann 92683ad2e2 login: share VT-signal handler between sessions
sd-event does not allow multiple handlers for a single signal. However,
logind sets up signal handlers for each session with VT_PROCESS set (that
is, it has an active controller). Therefore, registering multiple such
controllers will fail.

Lets make the VT-handler global, as it's mostly trivial, anyway. This way,
the sessions don't have to take care of that and we can simply acknowledge
all VT-switch requests as we always did.
2014-08-13 09:05:20 +02:00
Tom Gundersen 38de08a7e4 networkd: dhcp4 - fix copy-paste error
Reported by poma.
2014-08-12 23:12:09 +02:00
Tom Gundersen ccf1c0299f networkd: disable ipv4ll default routes by default
This causes machines without connectivity to hang where they would otherwise fail. Keep it
opt-in for now, but consider whether we sholud just drop it.
2014-08-12 20:50:13 +02:00
Tom Gundersen 54cba0b16c sd-network: split the operstate 'unknown' into 'down' and 'up' 2014-08-12 20:42:59 +02:00
Tom Gundersen 3c9b886068 networkd: link - split out dhcp4 handling 2014-08-12 20:42:59 +02:00
Tom Gundersen 68ba387706 udev: link-config - fix naming policy
Don't exit the name-finding loop when the 'kernel' policy is detected. We should
still find a fallback name if possible in the (very likely) case that no kernel
name is set at all.
2014-08-12 20:42:59 +02:00
Tom Gundersen 464cf22f17 udev: link-config - whitespace
Don't overflow 80 cols unneccessarily (we are ok with doing it when it improves readability, but that's not the case here).
2014-08-12 20:42:59 +02:00
Tom Gundersen 77a008c090 networkd: link - fix IN_SET usage 2014-08-12 20:42:59 +02:00
Tom Gundersen b22d8a00f4 networkd: link - split out ipv4ll handling 2014-08-12 20:42:59 +02:00
Tom Gundersen 431ca2cebb networkd: link - make check for whether addresses/routes are being configured implicit 2014-08-12 20:42:59 +02:00
Tom Gundersen 0b1831c20c networkd: split out networkd-link.h 2014-08-12 20:42:59 +02:00
Lennart Poettering 874ff7bf4d timesyncd: beef up NTP server selection logic, and acquire NTP servers from DHCP 2014-08-12 19:48:24 +02:00
Lennart Poettering 96e6e39443 resolved: return exit code of event loop 2014-08-12 19:33:09 +02:00
Lennart Poettering 3e684349c2 resolved: unify logic how we flush out DNS servers we learnt 2014-08-12 19:32:55 +02:00
Lennart Poettering 96c76ac49c sd-resolve: scale number of threads by queries currently being processed, rather than number of queries currently referenced
This way a query that blocks for a longer time, and whose reference has
been dropped won't block subsequent lookups from finishing.
2014-08-12 19:30:18 +02:00
Lennart Poettering 85529c815b sd-resolve: fix allocation if query ids, never reuse them 2014-08-12 19:29:27 +02:00
Lennart Poettering 502fe44ea4 sd-resolve: keep floating query referenced while we access it 2014-08-12 19:28:32 +02:00
Lennart Poettering 84e51726a3 timesyncd: split up into multiple source file
The source file got much too large, hence split up the sources into
multiple per-object files, similar in style to resolved.
2014-08-12 16:58:56 +02:00
Lennart Poettering f7d68aa8c9 networkctl: make networkctl status without link name show all local IP addresses 2014-08-12 16:19:37 +02:00
Lennart Poettering 6d0c65ffb4 networkctl: when outputing a list fo links, sort them by ifindex 2014-08-12 16:03:45 +02:00
Lennart Poettering df3fb561b2 networkctl: add a bit of color to the output 2014-08-12 15:41:01 +02:00
Lennart Poettering 9085f64a66 networkctl: add new switch "-a" to "networkctl status" to show verbose status of all local links 2014-08-12 15:19:30 +02:00
Lennart Poettering 1b17f21198 networkctl: properly format MAC addresses 2014-08-12 15:08:09 +02:00
Lennart Poettering 03cc0fd143 sd-network: add API to output all collected system-wide NTP and DNS servers
Also, output the collected information in "networkctl".
2014-08-12 15:06:51 +02:00
Lennart Poettering f01e5736f1 timesyncd: move the generic sockaddr_equal() call to socket-util.h 2014-08-12 14:54:32 +02:00
Lennart Poettering c0c743cb3d networkd: expose a global list of DNS and NTP servers in the state file 2014-08-12 13:02:27 +02:00
Lennart Poettering 87f5a19343 resolved: filter out duplicate DNS servers when writing resolv.conf 2014-08-12 13:02:27 +02:00
Lennart Poettering c2d6bd61ee networkd: update manager_save() to use fflush_and_check() to simplify things a bit 2014-08-12 13:02:27 +02:00
Thomas Hindoe Paaboel Andersen bf1594f54e resolved: initialize counter
introduced in: a407657425
2014-08-12 04:42:33 +02:00
Lennart Poettering 91d3efeddd networkd: fix build 2014-08-12 02:33:37 +02:00
Lennart Poettering a903fd34c0 sd-network: move sd-network API into libsystemd proper
In contrast to the DHCP/IPv4LL/ICMP6 APIs sd-network is not a protocol
implementation but a client API for networkd, hence move it into
libsystemd proper.
2014-08-12 02:12:05 +02:00
Lennart Poettering 7bfe1e9cb0 sd-network: remove client-side dhcp API
The networkd should abstract the difference between DHCP supplied and
configured data, and hence the DHCP lease concept should not exposed on
the client side.

Should we want to support arbitrary DHCP fields one day, we can add a
new sd_network_get_link_dhcp_field() call or so.
2014-08-12 02:04:17 +02:00
Lennart Poettering ee8c456895 networkd: add minimal client tool "networkd" to query network status
In the long run this should become a full fledged client to networkd
(but not before networkd learns bus support). For now, just pull
interesting data out of networkd, udev, and rtnl and present it to the
user, in a simple but useful output.
2014-08-12 01:54:40 +02:00
Lennart Poettering 1cb5d1f319 udev: modernize net_id builtin a bit 2014-08-12 01:54:39 +02:00
Lennart Poettering 6436165dbc sd-network: rename the per-ifindex calls to sd_network_get_link_xxx()
This way we can introduce system-wide versions of these calls that are
called the same way, but without the "link" in the name.
2014-08-11 22:56:52 +02:00
Lennart Poettering 44e7b94926 networkd: monopolize in_addr utility functions in shared/in-addr-util.h
Primarily, this means we get rid of net_parse_inaddr(), and replace it
everywhere with in_addr_from_string() and in_addr_from_string_auto().
These functions do not clobber the callers arguments on failure, which
is more close to our usual coding style.
2014-08-11 22:46:42 +02:00
Lennart Poettering cedc8c44d4 timesyncd: when we don't know anything about the network state, assume we are online
This should provide better compatibility with systems that lack networkd
2014-08-11 22:04:37 +02:00
Lennart Poettering 17fdb7661b build-sys: add missing makefile symlinks 2014-08-11 20:15:14 +02:00
Lennart Poettering 5168f84a29 udev: never bypass our own logging framework and call vsyslog() directly from udev tools 2014-08-11 20:13:38 +02:00
Lennart Poettering c1dc6153c9 log: never ever log to syslog from PID 1, log to the journal again
We don't support journal-less systems anyway, so let's avoid the
confusion.
2014-08-11 20:08:08 +02:00
Olivier Brunel baccf3e40b login: set_controller should fail if prepare_vt fails
If controllers can expect logind to have "prepared" the VT (e.g. set it to
graphics mode, etc) then TakeControl() should fail if said preparation
failed (and session_restore_vt() was called).

(David: fixed up !CONFIG_VT case and errno-numbers)
2014-08-11 18:38:44 +02:00
Lennart Poettering 7e8185ef94 fix a couple of more lazy "return -1"
Fix should strictly follow the rule to return negative errno-style
error codes from functions, hence let's fix more "return -1"-style
lazinesses.
2014-08-11 18:35:54 +02:00
Lennart Poettering d7bf74d9cc journal-remote: fix parsing of fd command line argument 2014-08-11 18:24:43 +02:00
Lennart Poettering fd006cce38 initctl: don't eat up error code 2014-08-11 18:24:28 +02:00
Lennart Poettering a2715692e2 bootchart: use the bool type where appropriate 2014-08-11 18:24:08 +02:00
Lennart Poettering 4155f7d4be bootchart: it's not OK to return -1 from a main program 2014-08-11 18:23:47 +02:00
Lennart Poettering 0cdfd26ef8 util: avoid considering dpkg temporary files relevant for anything
https://bugs.freedesktop.org/show_bug.cgi?id=82453
2014-08-11 15:32:09 +02:00
Lennart Poettering 6a5c7b7e41 timesyncd: always use CLOCK_BOOTTIME if we can
After all we want to compare a monotonically increasing clock with the
remote clock, hence we shouldn't ignore system suspend periods.
2014-08-11 15:06:22 +02:00
Lennart Poettering 556a22945f resolved: when picking a new hostname make sure two hosts pick different ones
This way we can avoid always picking the same replacement hostnames when
picking one.
2014-08-11 15:06:22 +02:00
Lennart Poettering 4d91eec42d resolved: actually, the peer with the lower IP address wins conflicts 2014-08-11 15:06:22 +02:00
Lennart Poettering 3ef64445cd resolved: make sure we don't mark the wrong zone RRs conflicting 2014-08-11 15:06:22 +02:00
Lennart Poettering 2fb3034cb2 resolved: be a bit more communicative about conflicts 2014-08-11 15:06:22 +02:00
Lennart Poettering 902bb5d8ab resolved: verify all RRs when we come back from suspend 2014-08-11 15:06:22 +02:00
Lennart Poettering 82bd6dddc4 resolved: destroy outstanding queries if the clients that initiated them die 2014-08-11 15:06:22 +02:00
Lennart Poettering 818f766b12 resolved: properly pass aborted transaction result back to clients 2014-08-11 15:06:22 +02:00
Lennart Poettering a407657425 resolved: implement full LLMNR conflict detection logic 2014-08-11 15:06:22 +02:00
Lennart Poettering 3ef77d0476 resolved: properly check return value of dns_resource_record_equal() 2014-08-11 15:06:22 +02:00
Daniel Mack 15aa9b201c sd-bus: sync kdbus.h (ABI break) 2014-08-10 21:46:45 +02:00
Harald Hoyer 37d6781b31 Added arch tuple for PPC64LE
Thanks to Brent Baude <bbaude@redhat.com>, who checked with the debian
guys, that this is correct and provided the patch.
2014-08-08 16:54:13 +02:00
Tom Gundersen 04b67d4925 udev: link_setup - respect kernel name assign policy
Newer kernels export meta-information about the origin of an ifname. Respect this
from the ifname rename logic. We do not rename any interfaces that was originally
named by userspace, nor once which have already been renamed from userspace.

Moreover, we optionally do not (the default) rename interfaces which the kernel
claims to have named in a predictable way.
2014-08-08 13:30:15 +02:00
Tom Gundersen f3fc48150b core: loopback-setup - only up the loopback device
The kernel will set up the IP addresses for us, so don't duplicate that
in userspace.
2014-08-08 13:09:51 +02:00
Zbigniew Jędrzejewski-Szmek d1fab3fe88 core: warn when merged units have conflicting dependencies
A unit should not Conflict with itself. It also does not make
much sense for a unit to be After or Before itself, or to
trigger itself in some way.

If one of those dependency types is encountered, warn, instead
of dropping it silently like other dependency types.

% build/systemd-analyze verify test/loopy3.service
...
Dependency Conflicts dropped when merging unit loopy4.service into loopy3.service
Dependency ConflictedBy dropped when merging unit loopy4.service into loopy3.service
2014-08-07 20:46:49 -04:00
Zbigniew Jędrzejewski-Szmek e66047ff62 core: do not add dependencies to self
Adds a pair of files which cause a segfault (also with
systemd-analyze verify).

https://bugzilla.redhat.com/show_bug.cgi?id=1124843
2014-08-07 20:42:58 -04:00
Thomas Hindoe Paaboel Andersen 17a6dfa3be bus-proxy: service_name_is_valid will never be < 0 2014-08-05 18:22:31 +02:00
Lennart Poettering e56187ca4a resolved: don't abort if a transaction is aborted because its scope is removed 2014-08-05 17:02:46 +02:00
Lennart Poettering 6e06847294 resolved: add 100ms initial jitter to all LLMNR requests 2014-08-05 17:02:46 +02:00
Lennart Poettering aea2429d6e resolved: enforce ratelimit on LLMNR traffic 2014-08-05 17:02:46 +02:00
Martin Pitt 7925709c9a udev-builtin-keyboard: Allow numeric key codes
Like with the old udev rules, allow hwdb entries to specify numeric key codes.
Based on a patch from Mircea Miron.

https://launchpad.net/bugs/1247584
2014-08-05 10:40:46 +02:00
Lennart Poettering 7b85d72f82 resolved: don't consider tentative addresses relevant 2014-08-05 04:18:23 +02:00
Lennart Poettering cc7844e787 resolved: fix a message typo 2014-08-05 04:18:01 +02:00
Lennart Poettering d84b686f06 resolved: stop the prober when we detect a conflict in LLMNR 2014-08-05 04:17:45 +02:00
Lennart Poettering 60eb3f7cf1 resolved: don't override zone item state after starting the probe
After all, the probe might be finished immeidately (due to resources,
...), and we shouldn't then set the state back to probing.
2014-08-05 04:17:12 +02:00
Lennart Poettering 13b551acb6 resolved: when sending fails, don't try connecting to the next DNS server if we actually use LLMNR as protocol 2014-08-05 04:15:45 +02:00
Lennart Poettering 8c0b803b97 journald: remove redundant newlines 2014-08-05 04:14:02 +02:00
Lennart Poettering a174f94d52 journald: properly sum up entry size counter
We should read the entry size before moving to the next iovec, not
after.
2014-08-05 04:14:02 +02:00
Lennart Poettering dc4d47e2c7 resolved: never reuse transactions for probing that are already completed based on cached data 2014-08-05 01:52:25 +02:00
Lennart Poettering 4d926a69bc resolved: bypass local cache when we issue a transaction for verification purposes 2014-08-05 01:52:24 +02:00
Lennart Poettering cd1b20f90a resolved: if there's already an RR established that has the same name of an RR to be established, skip probing the name
After all, what has been probed once, doesn't need to be probed again.
2014-08-05 01:52:24 +02:00
Thomas Hindoe Paaboel Andersen 24fb7c1fa6 sysusers: isempty will never be < 0
looks like a typo from 	1b99214789
2014-08-04 23:28:02 +02:00
Thomas Hindoe Paaboel Andersen 8e21100002 test: use fabs on doubles 2014-08-04 23:28:02 +02:00
Lennart Poettering 21d73c87b0 resolved: actually read the initial state data from networkd when we initialize 2014-08-04 23:08:49 +02:00
Lennart Poettering 19b50b5ba7 resolved: read the per-interface LLMNR setting from networkd and act on it 2014-08-04 23:08:03 +02:00
Lennart Poettering b3df0b34c1 sd-network: when the LLMNR setting is not known for an interface consider that as ENODATA
ENODATA should be returned whenever we have no idea about something. A
missing LLMNR setting can only really happen during upgrades, in whichc
ase we really have no idea, so let's turn this into another ENODATA
case.
2014-08-04 23:06:07 +02:00
Lennart Poettering 2cd666f8c9 sd-network: actually open the state file in sd_network_get_llmnr() 2014-08-04 23:05:26 +02:00
Tom Gundersen 59b8f6b628 sd-dhcp-server: always send out ROUTER and SUBNET_MASK
For now we simply take these values from the server's address.
2014-08-04 20:58:15 +02:00
Lennart Poettering f0e1546763 resolved: fix order in which we destroy manager resources 2014-08-04 19:59:05 +02:00
Lennart Poettering edc501d467 resolved: when there's already somebody listening on the LLMNR ports, simple disable LLMNR and warn, but continue
This allows us to run resolved inside an nspawn container that shares
the network namespace with the host, if there's already an instance
running.
2014-08-04 19:48:03 +02:00
Lennart Poettering 4f758c2398 nspawn: make sure that when --network-veth is used both the host and the container side get fixed MAC addresses 2014-08-04 19:15:07 +02:00
Lennart Poettering 3a6fb33c54 machined: fix address API signatures 2014-08-04 19:05:06 +02:00
Lennart Poettering e70bc43cdf machine: make sure unpriviliged "machinectl status" can show the machine's OS version 2014-08-04 18:58:23 +02:00
Kay Sievers e98bbfd207 udev: path_id - suppress ID_PATH for devices with an unknown parent device type
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1321816
2014-08-04 18:16:23 +02:00
Tom Gundersen bd8f653876 networkd: add and expose per-link LLMNR config option 2014-08-04 16:56:34 +02:00
Lennart Poettering 9ccde88c5a resolve-host: properly align long arguments in help text 2014-08-04 16:25:24 +02:00
Lennart Poettering 249968612f bus: always explicitly close bus from main programs
Since b5eca3a205 we don't attempt to GC
busses anymore when unsent messages remain that keep their reference,
when they otherwise are not referenced anymore. This means that if we
explicitly want connections to go away, we need to close them.

With this change we will no do so explicitly wherver we connect to the
bus from a main program (and thus know when the bus connection should go
away), or when we create a private bus connection, that really should go
away after our use.

This fixes connection leaks in the NSS and PAM modules.
2014-08-04 16:25:24 +02:00
Zbigniew Jędrzejewski-Szmek 61b385c616 terminal: avoid warning about signed-unsigned comparison 2014-08-03 23:53:49 -04:00
Zbigniew Jędrzejewski-Szmek 590baf91f3 resolve-host: fix missed search&replace 2014-08-03 23:53:49 -04:00
Zbigniew Jędrzejewski-Szmek fa1c4b518e Fix misuse of uint64_t as size_t
They have different size on 32 bit, so they are really not interchangable.
2014-08-03 23:53:49 -04:00
Zbigniew Jędrzejewski-Szmek 1f2b7175cf util.h: fix typo 2014-08-03 22:50:16 -04:00
Zbigniew Jędrzejewski-Szmek 151226ab4b resolved: RRSIG records 2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek ff3d6560be resolved: add identifiers for dnssec algorithms 2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek 8db0d2f5c3 resolved: DNSKEY records 2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek de292aa1dd resolve-host: make arg_type an int
We are using it also to store _DNS_TYPE_INVALID, so it should be signed.
2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek 7263f72499 resolve: add more record types and convert to gperf table
We are unlikely to evert support most of them, but we can at least
display the types properly.

The list is taken from the IANA list.

The table of number->name mappings is converted to a switch
statement. gcc does a nice job of optimizing lookup (when optimization
is enabled).

systemd-resolve-host -t is now case insensitive.
2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek 23432a1c24 resolved: align last rr column 2014-08-03 21:46:08 -04:00
Zbigniew Jędrzejewski-Szmek 1d749d044b tty-ask-password-agent: modernization 2014-08-03 21:46:07 -04:00
Zbigniew Jędrzejewski-Szmek 601185b43d Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.

When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.

Also, simplify things here and there.
2014-08-03 21:46:07 -04:00
Thomas Hindoe Paaboel Andersen 75cd513ef8 resolved: avoid possible dereference of null pointer
In dns_scope_make_reply_packet the structs q, answer, and soa can be
null. We should check for null before reading their fields.
2014-08-03 23:01:57 +02:00
Thomas Hindoe Paaboel Andersen 621ac3d2cc sd-dhcp-server: avoid returning garbage value
Force renewing with a pool size of 0 would return the uninitialized r.
2014-08-03 20:42:59 +02:00
Thomas Hindoe Paaboel Andersen c15fb62a73 sd-dhcp-server: check if r < 0 2014-08-03 20:42:59 +02:00
Thomas Hindoe Paaboel Andersen be63641349 resolve-host: use correct format specifier 2014-08-03 13:19:24 +02:00
Thomas Hindoe Paaboel Andersen e850d8e1ac resolved: remove unused variables 2014-08-03 13:19:19 +02:00
Dan Dedrick 23f25b1496 switch-root: umount the old root correctly
The unmount occurs after the pivot_root, so the path used to unmount
should take into account the new root directory. This will allow the
umount to actually succeed.
2014-08-03 01:32:08 -04:00
Zbigniew Jędrzejewski-Szmek 4212a3375e nspawn: fix truncation of machine names in interface names
Based on patch by Michael Marineau <michael.marineau@coreos.com>:

When deriving the network interface name from machine name strncpy was
not properly null terminating the string and the maximum string size as
returned by strlen() is actually IFNAMSIZ-1, not IFNAMSIZ.
2014-08-03 01:29:51 -04:00
Karel Zak 9a6f36c08f bootchart: ask for --rel when failed to initialize graph start time
We always read system uptime before log start time. So the uptime
should be always smaller number, except it includes system suspend
time. It seems better to ask for --rel and exit() than try to be
smart and try to recovery from this situation or generate huge
messy graphs.
2014-08-03 01:12:53 -04:00
Karel Zak c358d728e7 bootchart: don't parse /proc/uptime, use CLOCK_BOOTTIME
* systemd-bootchart always parses /proc/uptime, although the
  information is unnecessary when --rel specified

* use /proc/uptime is overkill, since Linux 2.6.39 we have
  clock_gettime(CLOCK_BOOTTIME, ...). The backend on kernel side is
  get_monotonic_boottime() in both cases.

* main() uses "if (graph_start <= 0.0)" to detect that /proc is
  available.

  This is fragile solution as graph_start is always smaller than zero
  on all systems after suspend/resume (e.g. laptops), because in this
  case the system uptime includes suspend time and uptime is always
  greater number than monotonic time. For example right now difference
  between uptime and monotonic time is 37 hours on my laptop.

  Note that main() calls log_uptime() (to parse /proc/uptime) for each
  sample when it believes that /proc is not available. So on my laptop
  systemd-boochars spends all live with /proc/uptime parsing +
  nanosleep(), try

    strace  /usr/lib/systemd/systemd-bootchart

  to see the never ending loop.

  This patch uses access("/proc/vmstat", F_OK) to detect procfs.
2014-08-03 01:12:53 -04:00
Zbigniew Jędrzejewski-Szmek 799a8f39d8 journal-remote: rename KEY_FILE to avoid confict with <linux/input.h> 2014-08-03 01:12:30 -04:00
Zbigniew Jędrzejewski-Szmek 7bed7f0e3b Move BTRFS_IOC_DEVICES_READY to missing.h 2014-08-03 00:28:12 -04:00
Simon McVittie dced15575f util.h: include missing.h, for struct file_handle
This breaks udev-builtin-btrfs.c, which reinvents some of missing.h,
so use missing.h there too.

[zj: removed #include "config.h" and wrapped #include <linux/btrfs.h>
     in ifdef HAVE_LINUX_BTRFS_H as discussed on the mailing list.]
2014-08-03 00:28:12 -04:00
Tom Gundersen ac9c87dbc4 Revert "libudev: use get_*_creds from shared rather than util_lookup_*"
This reverts commit a56ba6158b.

The commit was pushed in error.
2014-08-01 22:33:20 +02:00
Lennart Poettering 7b4c2ee75f resolved: always drop multicast membership before adding one
This is apparently necessary on some devices, such as veth.
2014-08-01 20:27:27 +02:00
Lennart Poettering 747c0ff564 resolved: IPV6_UNICAST_IF may fail if we already are bound to a device, like we are for link-local addresses 2014-08-01 19:25:06 +02:00
Lennart Poettering 9198814968 missing: add missing bonding definitions 2014-08-01 18:55:56 +02:00
Lennart Poettering 2c27fbca2d resolved: flush cache each time we change to a different DNS server 2014-08-01 18:10:01 +02:00
Lennart Poettering 5cb36f41f0 resolved: read the system /etc/resolv.conf unless we wrote it ourselves
This way we integrate nicely with foreign network management stacks,
such as NM.
2014-08-01 18:10:01 +02:00
Tom Gundersen afe7fd56f5 networkd: track the MTU of each link
And inform the DHCPv4 clients about it.
2014-08-01 16:34:50 +02:00
Tom Gundersen 324f818781 sd-dhcp-client: allow the max dhcp message size to be set to the MTU of the link 2014-08-01 16:34:50 +02:00
Tom Gundersen a56ba6158b libudev: use get_*_creds from shared rather than util_lookup_* 2014-08-01 16:34:50 +02:00
Lennart Poettering 39d8db043b resolved: rename resolved.h to resolved-manager.h
After all it pretty much exlcusively containers definitions about the
"Manager" object, hence let's call this the most obvious way.
2014-08-01 16:14:59 +02:00
Lennart Poettering 4e945a6f79 resolved: beef up DNS server configuration logic
We now maintain two lists of DNS servers: system servers and fallback
servers.

system servers are used in combination with any per-link servers.

fallback servers are only used if there are no system servers or
per-link servers configured.

The system server list is supposed to be populated from a foreign tool's
/etc/resolv.conf (not implemented yet).

Also adds a configuration switch for LLMNR, that allows configuring
whether LLMNR shall be used simply for resolving or also for responding.
2014-08-01 16:06:39 +02:00
Lennart Poettering e70df46b97 nss: always explicitly reset all error variables
glibc appears to be broken if we don't explicitly reset all error
variables, let's work around that.

https://bugzilla.redhat.com/show_bug.cgi?id=1125975
2014-08-01 16:06:39 +02:00