b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
d390f8ef2dc0cd041914d3c2fd3e1081605cbfc8 |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
util: introduce fputs_with_space() and make use of it at various places
The call combines outputing a string with prefixing it with a space, optionally. This is useful to shorten the logic
for outputing lists of strings, that are space separated. |
b2a81c0b524fee0a1713720462b6db5c302c3933 |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
networkd: optinally use DHCP lease domain info for routing only
This changes the UseDomains= setting of .network files to take an optional third value "route", in addition to the
boolean values. If set, the passed domain information is used for routing rules only, but not for the search path
logic. |
27cb34f57458758ee8615d72c6a60a39d4b92226 |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
networkd: rename a few Network object properties to be more like the configuration settings
All booleans called dhcp_xyz are now called ".dhcp_use_xyz", to match their respective configuration file settings. This
should clarify things a bit, in particular as there is a DHCP hostname that was previously called just ".hostname"
because ".dhcp_hostname" was already existing as a bool. Since this confusion is removed now because the bool is called
".dhcp_use_hostname", the string field is now renamed to ".dhcp_hostname". |
482d1aeb671e813535f0ff9fadf4e1827ee32e20 |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
networkd: when filtering out duplicate domain names use DNS comparison
When we collect the domain names of the various links and other sources in one ordered set, make sure to use proper DNS
name comparison to filter out duplicates. |
0061695507e889069c0c974cf85cd570f7ec9a88 |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
networkd: use an OrderedSet instead of Set to collect link domains
For the search domain logic the order is highly relevant, hence make sure when collecting the various search domains to
add them to an ordered set, so that the order between search domains of a specific link is retained. |
3df9bec57c3e2d96f7e2a25961585cfa609b61eb |
|
26-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
networkd: rework Domains= setting
Previously, .network files only knew a vaguely defined "Domains=" concept, for which the documentation declared it was
the "DNS domain" for the network connection, without specifying what that means.
With this the Domains setting is reworked, so that there are now "routing" domains and "search" domains. The former are
to be used by resolved to route DNS request to specific network interfaces, the latter is to be used for searching
single-label hostnames with (in addition to being used for routing). Both settings are configured in the "Domains="
setting. Normal domain names listed in it are now considered search domains (for compatibility with existing setups),
while those prefixed with "~" are considered routing domains only. To route all lookups to a specific interface the
routing domain "." may be used, referring to the root domain. An alternative syntax for this is the "*", as was already
implemented before using the "wildcard" domain concept.
This commit adds proper parsers for this new logic, and exposes this via the sd-network API. This information is not
used by resolved yet, this will be added in a later commit. |
a0db8e46e574a5f8e226f4202c5d64eb05d14811 |
|
21-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
networkd: use (void) to mark ignored values
Null link or netdev are handled fine.
CID #1338084. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
4058d339f5b290ec970e1de0d3b804e4934acc20 |
|
11-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: improve logging |
f5a8c43f39937d97c9ed75e3fe8621945b42b0db |
|
11-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: IPv6 router discovery - follow IPv6AcceptRouterAdvertisemnt=
The previous behavior:
When DHCPv6 was enabled, router discover was performed first, and then DHCPv6 was
enabled only if the relevant flags were passed in the Router Advertisement message.
Moreover, router discovery was performed even if AcceptRouterAdvertisements=false,
moreover, even if router advertisements were accepted (by the kernel) the flags
indicating that DHCPv6 should be performed were ignored.
New behavior:
If RouterAdvertisements are accepted, and either no routers are found, or an
advertisement is received indicating DHCPv6 should be performed, the DHCPv6
client is started. Moreover, the DHCP option now truly enables the DHCPv6
client regardless of router discovery (though it will probably not be
very useful to get a lease withotu any routes, this seems the more consistent
approach).
The recommended default setting should be to set DHCP=ipv4 and to leave
IPv6AcceptRouterAdvertisements unset. |
1c8e710c2b479129c3ad06a0e8e2d21ae4aefd38 |
|
30-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - track routes |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
0d39fa9c69b97a2ceb156053deef69c0866c2b97 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move more file I/O related calls into fileio.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
58fda79c0bdea114f72ef5d9537039d01adeca37 |
|
22-Oct-2015 |
reverendhomer <mk.43.ecko@gmail.com> |
networkd-manager: fix swapped arguments
fixes Coverity #1328493 |
84de38c56915e14c148f558c6acc489a00755696 |
|
21-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: manager/link - only serialize once per event-loop iteration
Every time the state is written out we may trigger third-party apps, so
let's be a bit more careful about writing this out unnecessarily. |
adda1ed94a04742ddacdc76dfa311816e1ed9f68 |
|
21-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: address - distinguish between addresses added by us and by others
We only keep the addresses that we added ourselves in link->addresses, and
introduce a new set link->addresses_foreign to keep addresses of unknown
origin.
Only functional change is that "foreign" addresses no longer prevent a link
from entering "configured" state. |
36c32f6120a0c3fe19be5aeaa1926e179e8c29ba |
|
21-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: address - factor out address_update()
Call back into link_check_ready() whenever an address state change may have
made a link ready. |
8012cd391932d58b44332df106d426a360faf0a6 |
|
21-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: link - only consider configured when all addresses are ready
We were considering a link configured whilst its IPv6 addresses were still
tentative.
Fixes issue #650. |
91b5f997316ddc77d26f9a7a5e24c335484586bd |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: make address_{establish,release}() static
No need to expose these functions, but rather call them from address_{add,drop}. |
054f0db48775d566e4f55feb7cda0f721a9eb485 |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - avoid unnecessary memory allocation
Don't allocate Address objects only to free them again when processing
rtnl events. |
cf1d700da3fe04cd4c27980a292301694be3b05f |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: address - store active addresses in a Set rather than a List
We need to be able to look these things up quickly as we will be updating them
continuously and there can in principle be many of them. |
200a0868fcdf7b95f3d8d1fda3aa2aef48d84fdd |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: address - process in manager.c rather than link.c |
7d20d3759e375367c36471906ba898c6909d5132 |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - free bus after own objects
Freeing links/addresses may trigger sending signals over the bus, so let's make sure
the bus stays around until our own objects have been freed. |
75f86906c52735c98dc0aa7e24b773edb42ee814 |
|
07-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection. |
397d15fd397060a19a90969b6aa283965c40fb27 |
|
04-Sep-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
networkd: adjust error codes for nonexisting DHCP data
Commit 0339cd770 changed libsystemd-network's error code for missing DHCP lease
data from ENOENT to ENODATA. Adjust networkd accordingly.
This fixes interfaces being stuck in "degraded/configuring" mode forever.
https://github.com/systemd/systemd/issues/1147 |
c2c940bda03a07fbacfa3df2590ed865ec3dcc22 |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
networkd: s/now/know |
2f5b4a774a656d1da1daed604d3f4c15417c1897 |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
4f5f911e81ae6377ab925c1dd133013c640ab32e |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
fc2f9534d07db2b185c02b1961428b53daf1986e |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
networkd: split up networkd.h into per-object header files
No functional changes, just moving definitions into separate header
files. |
2f3cf1f9e18738e9882851dbc05aee67a5901336 |
|
26-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
7d6884b65e6ea7317346d29bc2f6c9ba051a0cac |
|
06-Aug-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: fix indentation |
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 |
|
29-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error
checking, let's unify all that by using fflush_and_check().
This also unifies the general error paths of fflush()+rename() file
writers. |
1c4baffc1895809bae9ac36b670af90a4cb9cd7d |
|
13-Jun-2015 |
Tom Gundersen <teg@jklm.no> |
sd-netlink: rename from sd-rtnl |
31710be527104abad7541b122ee10c4560bd14d2 |
|
11-Jun-2015 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl: make joining broadcast groups implicit |
ee0eb1d891eb0a41fb63368bff264f59cb2bb851 |
|
08-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
Revert "networkd: create "kernel" setting for IPForwarding" |
a70ec7f19f3375c9eeda9f9a2f4181ca008239fc |
|
03-Jun-2015 |
Nick Owens <nick.owens@coreos.com> |
networkd: create "kernel" setting for IPForwarding
In 5a8bcb674f71a20e95df55319b34c556638378ce, IPForwarding was introduced
to set forwarding flags on interfaces in .network files. networkd sets
forwarding options regardless of the previous setting, even if it was
set by e.g. sysctl. This commit creates a new option for IPForwarding,
"kernel", that preserves the sysctl settings rather than always setting
them.
See https://bugs.freedesktop.org/show_bug.cgi?id=89509 for the initial
bug report. |
190700621f95160d364f8ec1d3e360246c41ce75 |
|
29-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: drop bus parameter from message callback prototype
This should simplify the prototype a bit. The bus parameter is redundant
in most cases, and in the few where it matters it can be derived from
the message via sd_bus_message_get_bus(). |
cdfee94318506c9348f8c30b9b7a7c87ec75927c |
|
03-Apr-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: improve logging when processing links and addresses |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
f806f64c7460632d6b6c27865e1554cb6c934320 |
|
11-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: don't do exit-on-idle if there is something wrong with the dbus connection
Just fall back to plain old event loop in this (highly unlikely) case.
In the glorious future when kdbus is upstream we can of course drop all this. |
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865d |
|
08-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: add basic org.freedesktop.network1.Network interface |
dbffab87f1504abc9f189dd253111693c99fbd9a |
|
08-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: add network_get_by_name |
8f203c166ecb24f904a068f2d8f0c636c1511a8f |
|
05-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: move the connection to the bus out of manager_new (again)
This would otherwise make the tests fail as we cannot grab the bus name. |
a97dcc12e486ecff531809802930a26c4da827f2 |
|
05-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: exit on idle
We will be woken up on rtnl or dbus activity, so let's just quit if some time has passed and that is the only thing that can happen.
Note that we will always stay around if we expect network activity (e.g. DHCP is enabled), as we are not restarted on that. |
e331e24649213f2e093e16e4d3d64ee823dfc375 |
|
05-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: add basic dbus API
Only the very basics, more to come.
For now:
$ busctl tree org.freedesktop.network1
└─/org/freedesktop/network1
└─/org/freedesktop/network1/link
├─/org/freedesktop/network1/link/1
├─/org/freedesktop/network1/link/2
├─/org/freedesktop/network1/link/3
├─/org/freedesktop/network1/link/4
├─/org/freedesktop/network1/link/5
├─/org/freedesktop/network1/link/6
├─/org/freedesktop/network1/link/7
├─/org/freedesktop/network1/link/8
└─/org/freedesktop/network1/link/9
$ busctl introspect org.freedesktop.network1 /org/freedesktop/network1
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.network1.Manager interface - - -
.OperationalState property s "carrier" emits-change
$ busctl introspect org.freedesktop.network1 /org/freedesktop/network1/link/1
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.network1.Link interface - - -
.AdministrativeState property s "unmanaged" emits-change
.OperationalState property s "carrier" emits-change |
6a24f1484fcc1f59f89617afbe4282667a358eab |
|
05-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: don't warn about missing links unnecessarily
If we get a NEWLINK + NEWADDR between enumerating the links and enumerating the addresses, we
would get a warning that the link corresponding to the address does not exist. This is a false
warning as both the NEWLINK and NEWADDR would be processed after enumerating completed, so drop
it. |
5fae368bda9419d9d378ea32077c8fd183dd4b81 |
|
03-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: refactor socket activation a bit |
9c0a72f961e00b0447767973e7117e131bea5b5d |
|
03-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: handle suspend events |
44de0efc6e406515fc1cf8b95d9655d0d7f7ffff |
|
02-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
networkd: minor simplification
Let's return the fd we found as return value in systemd_netlink_fd(),
instead of using call-by-reference. |
5544ee85163733eaa50f598fcf3bd9421d4a42f9 |
|
02-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: support socket activation
Still keep the non-socket activation code around for starting from the commandline, but
will likely drop that too in the future. |
769d324c99aab129148bd25f5f663ef441287d86 |
|
13-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
networkd: make IP forwarding for IPv4 and IPv6 individually configurable |
cb9fc36a1211967e8c58b0502a26c42552ac8060 |
|
13-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
networkd: introduce an AddressFamilyBoolean enum type
This introduces am AddressFamilyBoolean type that works more or less
like a booleaan, but can optionally turn on/off things for ipv4 and ipv6
independently. THis also ports the DHCP field over to it. |
17d1f37d0dbd2d78b8866e1350c83a9755105144 |
|
15-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: failing to track links is a serious problem so log at warning level rather than debug |
45af44d47da6933b260c734ad9ff721f63f80a4d |
|
08-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - enumerate addresses globally, rather than per-link
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once. |
f647962d64e844689f3e2acfce6102fc47e76df2 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
print;'
$f
done
And a couple of manual whitespace fixups. |
c33b329709ebe2755181980a050d02ec7c81ed87 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation fixups. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
be660c371b231c253a97464ddd8f32ec8721da21 |
|
27-Nov-2014 |
Alin Rauta <alin.rauta@intel.com> |
networkd: fix kernel rtnl receive buffer overrun error
We got the following error when running systemd on a device with many ports:
"rtnl: kernel receive buffer overrun
Event source 'rtnl-receive-message' returned error, disabling: No buffer space
available"
I think the kernel socket receive buffer queue should be increased. The default
value is taken from:
"/proc/sys/net/core/rmem_default", but we can overwrite it using SO_RCVBUF
socket option.
This is already done in networkd for other sockets.
For example, the bus socket (sd-bus/bus-socket.c) has a receive queue of 8MB.
In our case, the default is 208KB.
Increasing the buffer receive queue for manager socket to 512KB should be enough
to get rid of the above error.
[tomegun: bump the limit even higher to 8M] |
356779df90a2ecab5da2cb310ad0f8ebc9ca9f46 |
|
04-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-event: rename sd_event_source_set_name() to sd_event_source_get_name()
To mirror the recent name change of the concept for sd_bus objects,
follow the same logic for sd_event_source objects, too. |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
124f09e8125e1eae5b058b1f287e72c85a46d557 |
|
13-Sep-2014 |
Dave Reisner <dreisner@archlinux.org> |
networkd: remove vestigial event sources
187fe1db took advantage of floating events, but didn't remove pointers
it made superfluous. |
9021bb9f935c93b516b10c88db2a212a9e3a8140 |
|
28-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
sd-event: name event sources used in libraries
This should help in debugging failing event sources. |
8612e9365333d35773a08509b1d80a98911acb44 |
|
15-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-network: add system-wide sd_network_get_domains() API |
d3df0e3982777fd5de8cffaa585eba0af3773c08 |
|
13-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
sd-network: rename operstates 'down' -> 'off' and 'up' -> 'no-carrier'
Suggested by Lennart and Kay. |
54cba0b16cdc94d5c21e8d805a4ade1255d43bc9 |
|
12-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
sd-network: split the operstate 'unknown' into 'down' and 'up' |
0b1831c20c4d30077b6560b2b7d88bdb220d5cef |
|
12-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: split out networkd-link.h |
c0c743cb3df7197b51bb89cc3c8ca7ed16d06396 |
|
12-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
networkd: expose a global list of DNS and NTP servers in the state file |
c2d6bd61ee77b59566116afe6e20513d19945ed4 |
|
12-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
networkd: update manager_save() to use fflush_and_check() to simplify things a bit |
ae06ab1014641feb83ffd0d08f0957e69bbbae08 |
|
28-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: store ifindex as int |
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56a |
|
18-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
change type for address family to "int"
Let's settle on a single type for all address family values, even if
UNIX is very inconsitent on the precise type otherwise. Given that
socket() is the primary entrypoint for the sockets API, and that uses
"int", and "int" is relatively simple and generic, we settle on "int"
for this. |
ca4e095ab9e970cb8fa472ae69ea1f0648041722 |
|
18-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-rtnl: make string returned by sd_rtnl_message_read_string() const |
3be1d7e0c5bf60658d34eb6311d4e77c6803578c |
|
14-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: netdev - introduce vtable for netdev kinds
Split each netdev kind into its own .h/.c. |
186fe1db20902b6542cee58ba499ced914d687a8 |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
networkd: simplify signal handling of SIGTERM/SIGINT
sd-event makes handling SIGTERM/SIGINT a lot easier than it used to,
let's make use of this |
1a941ac4b690cb3f4333e35f4a5036fe6fd50ff9 |
|
01-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: link - ignore missing MAC address
Currently DHCP/IPv4LL only works on ethernet devices, but no reason not to otherwise
manage them. |
5da8149fd33f07aabdac72880143ec13e516f933 |
|
01-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: link - improve refcounting
We failed to take a ref when waiting for udev synchronization. Fix that and also
make unreffing in callbacks simpler throughout by using _cleanup_ macros.
Fixes <https://bugs.freedesktop.org/show_bug.cgi?id=80556>. |
11bf3cced13c885ca215c108cb0bdb7a148520d6 |
|
18-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
85b5673b337048fa881a5afb1d00d1a7b95950fb |
|
03-Jun-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: split runtime config dir from state dir
Configuration will be in
root:root /run/systemd/network
and state will be in
systemd-network:systemd-network /run/systemd/netif
This matches what we do for logind's seat/session state. |
bddfc8afd329ac68a23f66a3512d4e249af25191 |
|
03-Jun-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: drop CAP_SYS_MODULE
Rely on modules being built-in or autoloaded on-demand.
As networkd is a network facing service, we want to limits its capabilities,
as much as possible. Also, we may not have CAP_SYS_MODULE in a container,
and we want networkd to work the same there.
Module autoloading does not always work, but should be fixed by the kernel
patch f98f89a0104454f35a: 'net: tunnels - enable module autoloading', which
is currently in net-next and which people may consider backporting if they
want tunneling support without compiling in the modules.
Early adopters may also use a module-load.d snippet and order
systemd-modules-load.service before networkd to force the module
loading of tunneling modules.
This sholud fix the various build issues people have reported. |
e375dcde7202d5df4e29f5258e0f8c2bcea4535c |
|
19-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd/sd-network: extend operational states
Expose states 'degraded' or 'routable' if a link has a site/link-local or a routable address, respectively. |
091a364c802e34a58f3260c9cb5db9b75c62215c |
|
19-May-2014 |
Tom Gundersen <teg@jklm.no> |
resolved: add daemon to manage resolv.conf
Also remove the equivalent functionality from networkd. |
2dcf7ec6ec0c28297311108acba119cd6e055e64 |
|
16-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - read fallback DNS servers from config file
We will still use the compiled-in defaults if no DNS entry exists in the config file. |
d4920165fe753751aaa274fdc568927d26284eea |
|
16-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: network - store DNS servers in List rather than Set
This way we preserve the order of preference. |
e16cb2e4efaba83f47da8355adc65fd83bbe8327 |
|
16-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: hardcode a set of default dns servers
Similarly to NTP servers, this can be set at compile-time. |
0b44d8c3d7dfadb60b30c9339b18c4cc1617b51b |
|
12-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - don't leak kmod context
Also, keep the kmod_new internal to networkd-manager.c |
7951dea20911969287878e6897b3eca348721ade |
|
12-May-2014 |
Susant Sahani <susant@redhat.com> |
networkd: introduce ipip tunnel
This patch enables basic ipip tunnel support.
It works with kernel module ipip
example conf:
file: ipip.netdev
[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480
[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64
file: ipip.network
[Match]
Name=em1
[Network]
Tunnel=ipip-tun
[tomegun:
- drop unused variable
- take ref when enslaving] |
fbbeb65a93e2f90f6576001b69def877cd98722d |
|
11-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: get preexiting addresses when a link is added |
2e9f08eaf11fdb9c702058524f634eb13298a966 |
|
10-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: listen for address changes
This is proof-of-concept only, as we only log the changes but don't do anything
with it. |
897e184c7d54156357fd204beafe06ab9bd0341a |
|
10-May-2014 |
Tom Gundersen <teg@jklm.no> |
rtnl: change from bitmask to enum for rtnl groups
The bitmask is deprecated in the kernel, so move to the new interface. At the moment
this does not make a difference for us, but it avoids having to change the API in the future. |
86e6e5d1b4e78d62d1a45539c1de141bc5e839aa |
|
10-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - initialize variables |
4d473d5dded03d3b682dc389d610bb6b2db6e5f7 |
|
10-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - refactor link tracking a bit |
f22364691bafc834a41cbe106f73f3da1a78d57f |
|
09-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - drop links and netdevs when we receive DELLINK |
14b746f72132324e637c4e39694bd474f85e19f7 |
|
09-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: introduce refcounting for Links and NetDevs |
bbf7c04821a71fec67eaf0e7a34d17afc5913c13 |
|
08-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-network: expose global operational state |
667fcc6d7dab1b98dfbbb65f8f14127d8690e70f |
|
19-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: manager - add a bit of debug output to udev ADD events |
505f8da7325591defe5f751f328bd26915267602 |
|
19-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: tie links to rtnl rather than udev
This essentially swaps the roles of rtnl and udev in networkd. After this
change libudev is only used for waiting for udev to initialize devices and
to get udev-specific information needed for some [Match] attributes.
This in particular simplifies the code in containers where udev is not really
useful, but also simplifies things and reduces round-trips in the non-container
case. |
208612034e16c6af0406fa0572da975bf8747d2e |
|
31-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: rewind rtnl message between passing it to functions
This makes updating link status on netdev links work again. |
2292547af9638e2b3f7e0e96a56dd6c909e516dc |
|
31-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: fix use-after-free
Free networks before links (the reverse of creation order). |
ba5596ec2ed65943b66d42fbe6e9ef7ebc79216c |
|
28-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: netdev - improve logging when setting ifindex |
d39edfc72f9296078a18014627bf0a2543b60627 |
|
24-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: netdev - verify that newlink messages has the expected kind
We match 'newlink' messages with expected netdev's based on their names. Now also
make sure that the receieved link has the expected kind. |
c49b33aca6fd6a66e2bc43dad4a12701b7df8472 |
|
20-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: update mac address in clients when it changes
Pass the mac address on to ipv4ll and dhcp clients so they always have
up-to-date information, and may react appropriately to the change.
Also drop setting the mac address from uevent, and only log when the
address actually changes. |
eed0eee85ac34abd81cd9e81fdb6a19f47b6c8a3 |
|
14-Mar-2014 |
Michael Olbrich <m.olbrich@pengutronix.de> |
networkd: fix typo
It's HAVE_SPLIT_USR not HAVE_SPLIT_USER |
06f021a8048583d66202e3ac5cd0a12386d33ac2 |
|
14-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: allow more than one static DNS server |
0ea51a1129b9984a3c6d96cef1b0e33c99b5e9cf |
|
14-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: fix creation of runtime dirs at startup
This allows us to drop the repeated attempted creations of the runtime dirs during runtime. |
d22f1006a1910e32ff099330d70badaf2aec75c6 |
|
06-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl/networkd: use new rtnl_message_read() API and drop helper
With the new sd_rtnl_message_read_string(), there is no longer a need for
rtnl_message_get_ifname(). |
0c2f9b84698b25e6065b9febd21486669a13870f |
|
22-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: handle SIGINT and SIGTERM |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
11a7f22939d21558df919cab44b8fbe36ab5dae0 |
|
18-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: refactor link_add() :(
Don't set set **ret when returning r < 0, as matching on the errno may easily
give false positives in the future leading to null pointer dereference.
Reported-by: David Herrmann <dh.herrmann@gmail.com> |
624b5a636f2e0003a67025274d7afe9ebc55423b |
|
13-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: correctly handle manager_free(NULL) |
60ad0c85e58ea8f546677c1d2e425551f7b96179 |
|
12-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: work inside containers
Udev does not run in containers, so instead of relying on it to tell us when a
network device is ready to be used by networkd, we simply assume that any
device was fully initialized before being added to the container. |
1a436809498faf6486815baa0338fb6b8e5def07 |
|
07-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: netdev - rename Netdev to NetDev
Both in the configuration file format and everywhere else in the code. |
a6cc569e33a05b07550c6c7b4d67d83d868f8bc1 |
|
07-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: split sd_dhcp_lease from sd_dhcp_client
This allows us users of the library to keep copies of old leases. This is
used by networkd to know what addresses to drop (if any) when the lease
expires.
In the future this may be used by DNAv4 and sd-dhcp-server. |
50add2909c2e4b13a04d285b058b1c2270137656 |
|
30-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: netdev - reduce chance of race when receiving netdev's ifindex
When creating a new link, the kernel will not inform us about the new ifindex
in its ack. We have to listen for newly created devices and deduce the new
ifindex by matching on the ifname.
We used to do this by waiting for a new device from libudev, but that is asking
for trouble, as udev will happily rename the device before handing it to us.
Listen on rtnl instead, the chance of the name being changed before reaching us
is much smaller (if not nil).
Kernel patch in the works to make this unneccessary. |
52433f6b65eccd1c54606dde999610640f3458ac |
|
22-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: add basic bonding support
Refactor bridging support to be generic netdev support and extend it to
cover bonding as well. |
039ebe6aebaebcaa18375b33caf1db5fe2551621 |
|
18-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client/networkd: add domainname support |
bcbca8291fe3beaed36dd672d8b544840cfc49de |
|
18-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: don't hard depend on system bus
We may not have a dbus daemon in the initrd (until we can rely on kdbus). In
this case, simply ignore any attempts at using the bus. There is only one user
for now, but surely more to come.
In order to work reliably in the real root without kdbus, but at the same time
don't delay boot when kdbus is in use, order ourselves after dbus.service. |
b2ad8a16eea1d125159fbd71974ea7c24dc0ab0a |
|
18-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: resolv.conf - reword comment
Take into account that users may want to use resolvconf(8), or similar. Also,
avoid repeated calls to fputs(). |
5d8364b3c5e06b8dbda75c07fdb707148dfd1656 |
|
16-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: resolv.conf - extend the comment a bit |
7ae4ef6d23bc884d0e0ee2ec9cf87ec99d0686bb |
|
16-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: refactor DNS support
Rather than keeping an array of pointers to addresses, just keep an array of addresses. |
1346b1f0388f4100bb3c2a2bb23bc881769c020c |
|
16-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client/networkd: add transient hostname support |
f3621dec5234757a8424b90431b681853e9effa2 |
|
12-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: fix wording |
3bef724f7e7f7eaca69881548b06e221b77d7031 |
|
12-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: generate resolv.conf
This adds support to generate a basic resolv.conf in /run/systemd/network.
This file will not take any effect unless a symlink is created from
/etc/resolv.conf.
Nameservers received over DHCP takes precedence over statically configured ones.
Note: /etc/resolv.conf is severely limited, so in the future we will likely
rather provide a much more powerfull nss plugin (or something to that effect),
but this should allow current users to function without any loss of
functionality. |
2ad8416dd057e7e3185169609ca3006e7649f576 |
|
09-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
No need to canonicalize fixed paths |
8b264404b6cc412d3a588ca1b54fd2c1b09c5270 |
|
03-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: link hash uses 64, not 32 bit keys |
aa3437a573ed2a2b2a03c9649fe11d27b40a772b |
|
03-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: print the ifindex of added links
This debug information may be useful when comapring to dropped rtnetlink messages. |
2672953bde548f3648eb6a24dbda415604262cea |
|
03-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: improve logging
This gives a bit better messages when a link is added twice. |
d0d311d62f5d922dba97f0023c068e2bf90e7803 |
|
03-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: add some debug info about notifications we ignore |
06a6e593011a8af10f8a824a0be140a5085dac3a |
|
02-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: only track state of links we are managing
If a network is not (yet) set for a link, we do not care about its state (as we
anyway don't know what to do with it). |
449f75549247b3b7b073a788f0f099ce6b7c5378 |
|
02-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: improve logging
Remove redundant messages, add some debugging ones and make wording more uniform. |
e120204729764f6243b60899eb907103e678bee2 |
|
18-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
core,logind,networkd: check for udev device initialization via enumeration matches
Instead of checking each device after we got it, check wuth an
enumeration filter instead, to make it more efficient. |
bf5332d2bf2a1acbba9daacf40570a4addbd3411 |
|
18-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
core,logind,networkd: don't pick up devices from udev before they finished udev initialization
Managers shouldn't pick up the devices the manage before udev finished
initialization, hence check explicitly for that. |
22936833e177d9e477e059ec2b4f4fa9213b4e19 |
|
17-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: rename link_update_flags to link_update
We are likely to track more than the flags in the future. |
7b77ed8cf36e8eca6017791626044b61ae2d68e7 |
|
13-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: be more conservative when returning errors from event handler callbacks
We really should return errors from event handlers if we have a
continous problem and don't know any other solution. |
cde93897cdefdd7c7f66c400a61e42ceee5f6a46 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: hook up sd-event with the service watchdog logic
Adds a new call sd_event_set_watchdog() that can be used to hook up the
event loop with the watchdog supervision logic of systemd. If enabled
and $WATCHDOG_USEC is set the event loop will ping the invoking systemd
daemon right after coming back from epoll_wait() but not more often than
$WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than
$WATCHDOG_USEC/4*3, to make sure the service manager is called in time.
This means that setting WatchdogSec= in a .service file and calling
sd_event_set_watchdog() in your daemon is enough to hook it up with the
watchdog logic. |
dd3efc0993b6e95ff04775e9125e2fc9d30fe261 |
|
04-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: add link-sense and simplify state-machine a bit
This listens to rtnetlink for changes to IFF_UP and IFF_LOWER_UP (link sense). The latter
is simply logged at the moment, but will be useful once we add dhcp support. |
02b59d57e0c08231645120077f651151f5bb2bab |
|
26-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: add bridge support
A bridge is specified in a .netdev file with a section [Bridge]
and at least the entry Name=.
A link may be joined to a bridge if the .network applied to it has
a Bridge= entry giving the name of the bridge in its [Network] section.
We eagerly create all bridges on startup, and links are added to
bridges as soon as they both appear. |
002f5de9a9d3f04982588433895dca9faa2c0f22 |
|
21-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: don't filter on udev tags
This removed the requirement for devices to be tagged with
'systemd-networkd' before they will be visible to networkd.
Still, as by default we don't ship any .network files, network
devices will simply be tracked, but not touched, unless the
admin configures things explicitly. |
0617ffabe86a6d366252477eafbe59a888b149d4 |
|
19-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: make sure Links and Networks are freed |
f882c247ad59776c3a7753bb963c1f8e2386cb79 |
|
17-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: make all calls async |
afc6adb5ec7e73bc13156c43f52fb015cd80cc68 |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce concept of a "default" event loop per-thread and make use of it everywhere
Try to emphasize a bit that there should be a mapping between event
loops and threads, hence introduce a logic that there's one "default"
event loop for each thread, that can be queried via
"sd_event_default()". |
f579559b3a14c1f1ef96c372e7626c4733e6ef7d |
|
09-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: add a basic network daemon
This daemon listens for and configures network devices tagged with
'systemd-networkd'. By default, no devices are tagged so this daemon
can safely run in parallel with existing network daemons/scripts.
Networks are configured in /etc/systemd/network/*.network. The first .network
file that matches a given link is applied. The matching logic is similar to
the one for .link files, but additionally supports matching on interface name.
The mid-term aim is to provide an alternative to ad-hoc scripts currently used
in initrd's and for wired setups that don't change much (e.g., as seen on
servers/and some embedded systems).
Currently, static addresses and a gateway can be configured.
Example .network file:
[Match]
Name=wlp2s0
[Network]
Description=My Network
Gateway=192.168.1.1
Address=192.168.1.23/24
Address=fe80::9aee:94ff:fe3f:c618/64 |