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. |
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. |
3b015d40c19d9338b66bf916d84dec601019c811 |
|
11-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: ndisc - handle router advertisement in userspace
Router Discovery is a core part of IPv6, which by default is handled by the kernel.
However, the kernel implementation is meant as a fall-back, and to fully support
the protocol a userspace implementation is desired.
The protocol essentially listens for Router Advertisement packets from routers
on the local link and use these to configure the client automatically. The four
main pieces of information are: what kind (if any) of DHCPv6 configuration should
be performed; a default gateway; the prefixes that should be considered to be on
the local link; and the prefixes with which we can preform SLAAC in order to pick
a global IPv6 address.
A lot of additional information is also available, which we do not yet fully
support, but which will eventually allow us to avoid the need for DHCPv6 in the
common case.
Short-term, the reason for wanting this is in userspace was the desire to fully
track all the addresses on links we manage, and that is not possible for addresses
managed by the kernel (as the kernel does not expose to us the fact that it
manages these addresses). Moreover, we would like to support stable privacy
addresses, which will soon be mandated and the legacy MAC-based global addresses
deprecated, to do this well we need to handle the generation in userspace. Lastly,
more long-term we wish to support more RA options than what the kernel exposes. |
f833694d4f6a6dffabc6a4e552ecbd40aa3ce479 |
|
30-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - add expiration support
This should really live in the kernel, but the netlink API currently
does not support it. Until support has been added, expire the route
from userspace. |
1c8e710c2b479129c3ad06a0e8e2d21ae4aefd38 |
|
30-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - track routes |
86655331bc28887def7998d321b14ef8fccbeaf9 |
|
30-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - clean up confusion between 'metric' and 'priority'
Different tools use different terms for the same concept, let's try
to stick with 'priority', as that is what the netlink API uses. |
2ce409569093f7c2c6732246978a901a27f2bce3 |
|
30-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - rename fields in struct |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
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. |
bb7ae737a36769553475b1ada882b06869b75b00 |
|
21-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - add hash_ops |
ed9e361a8a798f9fee353b5c7e0e23308e0d329f |
|
21-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route - simplify route_new() |
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}. |
f0213e3796b4dd66e546e2de4d677db319f9171b |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: route/address - simplify and unify creators
Rename new_dynamic() to simply _new() and reuse that from new_static(). |
12ca818ffddb77eb6a0fabe369a5bcbf6994ff8b |
|
30-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: clean up log_syntax() usage
- Rely everywhere that we use abs() on the error code passed in anyway,
thus don't need to explicitly negate what we pass in
- Never attach synthetic error number information to log messages. Only
log about errors we *receive* with the error number we got there,
don't log any synthetic error, that don#t even propagate, but just eat
up.
- Be more careful with attaching exactly the error we get, instead of
errno or unrelated errors randomly.
- Fix one occasion where the error number and line number got swapped.
- Make sure we never tape over OOM issues, or inability to resolve
specifiers |
0d07e595cc22379ec7388406c2f4f2a74eea9083 |
|
24-Sep-2015 |
Jens Kuske <jenskuske@gmail.com> |
networkd: add support to configure preferred source of static routes |
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. |
1c4baffc1895809bae9ac36b670af90a4cb9cd7d |
|
13-Jun-2015 |
Tom Gundersen <teg@jklm.no> |
sd-netlink: rename from sd-rtnl |
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. |
769b56a308c3f3d3952eda87fd4fb004207f4f49 |
|
09-Feb-2015 |
Tom Gundersen <teg@jklm.no> |
networkd: support route scopes
For now we only support the hardcoded values RT_SCOPE_{UNIVERSE,LOCAL,HOST},
and not numerical values or values from /etc/iproute2/rt_scopes.
This addresses https://bugs.freedesktop.org/show_bug.cgi?id=88508. |
935c0d26f7ca748e78a02f524908ede696dc4cda |
|
08-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: route - ignore unknown address family |
9e7e440835c43d81ffdbc299d2c07daaa641ed50 |
|
04-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: add support for source routing |
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. |
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(). |
59580681f5f950335b5ec40bb4c4a70dca6b2830 |
|
27-Nov-2014 |
Gavin Li <git@thegavinli.com> |
networkd: route - allow routes without a gateway
For IPv6, the kernel returns EINVAL if a route is added with the
RTA_GATEWAY attribute set to in6addr_any (::). A route without a
gateway is useful in some situations, such as layer 3 tunneling
(sit, gre, etc.).
This patch prevents the RTA_GATEWAY attribute from being added
when route.in_addr is ip6addr_any (::). |
46b0c76e2c355c0d0cc4792abb98cde07b28bc53 |
|
08-Sep-2014 |
Emil Renner Berthing <systemd@esmil.dk> |
networkd: add preferred source to dhcp4 gateway route
This makes DHCPv4 and IPv4LL coexist peacefully.
[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
separate variable to indicate when prefsrc should be applied] |
0b1831c20c4d30077b6560b2b7d88bdb220d5cef |
|
12-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: split out networkd-link.h |
44e7b9492617408130d11ffa451c2660942974f6 |
|
11-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
16aa63a00b5b1db23a9c0b8de350ebf482d90cd0 |
|
28-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: route/address - use trivial hash functions |
28cc555d8504c9429776aedbbe1fee7101258578 |
|
23-Jul-2014 |
Dan Williams <dcbw@redhat.com> |
networkd: set route protocol
All routes added by networkd are currently set RTPROT_BOOT, which according
to the kernel means "Route installed during boot" (rtnetlink.h). But this
is not always the case as networkd changes routing after boot too. Since
the kernel gives more detailed protocols, use them.
With this patch, user-configured static routes now use RTPROT_STATIC (which
they are) and DHCP routes use RTPROT_DHCP. There is no define for IPv4LL
yet, so those are installed as RTPROT_STATIC (though perhaps RTPROT_RA is
better?).
[tomegun: fixup
src/network/networkd-link.c:972:33: error: too few arguments to function 'route_new_dynamic'] |
337ede5693cb8860ee86a2d71ffedec682abf6bc |
|
15-Jul-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
networkd: remove unused variable |
5d8e593dce074bff966fc0a46579c61b4f3bc33a |
|
14-Jul-2014 |
Susant Sahani <susant@redhat.com> |
networkd: make metric of routes configurable
Now route metric can be configuted via conf file:
example conf:
[Match]
Name=em1
[Route]
Gateway=192.168.1.12
Metric=10
Test:
ip route output
default via 192.168.1.12 dev em1 metric 10
[tomegun: squash TODO update and reword man page a bit] |
563c69c6b2c2bd691352ef522cb9ec95c08a0c63 |
|
03-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: netdev - take ref immediately after calling out
Keeping the refcounting next to the sd_bus_call_async() makes it easier to check. |
3d3d425547a3f38473fcf8737b85dfebb630479d |
|
16-May-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: rename Address and Route list fields |
c6f7c917a1b494d4455800823472227463f87438 |
|
21-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
libsystemd-network: move network-utils from src/shared
This does not belong in shared as it is mostly a detail of our networking subsystem.
Moreover, now we can use libudev here, which will simplify things. |
5c1d3fc93d91384bbac29adf01074fa4375317ea |
|
03-Mar-2014 |
Umut Tezduyar Lindskog <umut.tezduyar@axis.com> |
sd-network: IPv4 link-local support [v2]
Implements IPv4LL with respect to RFC 3927
(http://tools.ietf.org/rfc/rfc3927.txt) and integrates it
with networkd. Majority of the IPv4LL state machine is
taken from avahi (http://avahi.org/) project's autoip.
IPv4LL can be enabled by IPv4LL=yes under [Network]
section of .network file.
IPv4LL works independent of DHCP but if DHCP lease is
aquired, then LL address will be dropped.
[tomegun: removed a trailing newline and a compiler warning] |
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. |
4fb7242cbbed0d865eb343548b8f0ee0fee71d85 |
|
18-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
sd-rtnl-message: store reference to the bus in the message
This mimics the sd-bus api, as we may need it in the future. |
d595c5cc9e894c3608ed634052b0ba93aa94bf2f |
|
13-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
rtnl: rename constructors from the form sd_rtnl_xxx_yyy_new() to sd_rtnl_xxx_new_yyy()
So far we followed the rule to always indicate the "flavour" of
constructors after the "_new_" or "_open_" in the function name, so
let's keep things in sync here for rtnl and do the same. |
cf6a8911738fe2635a5210769d5348b05b166691 |
|
13-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
rtnl: drop "sd_" prefix from cleanup macros
The "sd_" prefix is supposed to be used on exported symbols only, and
not in the middle of names. Let's drop it from the cleanup macros hence,
to make things simpler.
The bus cleanup macros don't carry the "sd_" either, so this brings the
APIs a bit nearer. |
801bd9e859d7f3f127617172910786929776472b |
|
30-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
net-util: verify the address family
Error out if the address family is already set to something incompatible with the
address being parsed. |
b3070dc0258831c7e2b13624f75fa3dbd80d9833 |
|
05-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: refuse to use .network files with missing Address/Gateway key
These keys are mandatory in [Address]/[Route] sections. Otherwise, we
hit an assert:
ens3: setting addresses
Assertion 'address->family == 2 || address->family == 10' failed at /build/amd64-generic/tmp/portage/sys-apps/systemd-9999-r1/work/systemd-9999/src/network/networkd-address.c:137, function address_configure(). Aborting.
Reported-by: Alex Polvi <alex.polvi@coreos.com>
At the same time make sure Route's Destination and Gateway uses the same address family. |
f048a16b464295a4e0a4f4c1210f06343ad31231 |
|
01-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
networkd: distinguish between static and dynamic addresses/routes
Static addresses/routes are associated with a network. Dynamic
addresses/routes are associtade with links (as the corresponding network
may be shared by several links). |
ae4c67a7c6bb4efb858822838efe81008c965a98 |
|
17-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: add support for Route sections |
0a0dc69b655cfb10cab39133f5d521e7b35ce3d5 |
|
16-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
rtnl: replace message_append by typesafe versions |
1f01fb4f29bbe6aff952331a538fb3cc7f52dab4 |
|
16-Dec-2013 |
Tom Gundersen <teg@jklm.no> |
rtnl: simplify route_new()
Drop most of the arguments and instead introduce set_dst_prefixlen(). |
92fe133abf2de889659464ae8affd1db1710f72e |
|
28-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: fix several Address entries in [Network] section |
c166a070553511e402de5ad216d3fb62b49bdacb |
|
26-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: minor fixes
In particular, store the ifname, though we should only use it carefully, as
it is not guaranteed to be stable. Using it for logging is fine though. |
6ae115c1fe95611b39d2f20cfcea3d385429f59e |
|
25-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: add support for [Address] sections
This will allow specifying more options per address than the
simple Address= entry in the [Network] section.
Preliminary support for the same functionality for [Route] sections
are added, but not yet hooked up, as more testing is needed. |
71a6151083d842b2f5bf04e50239f0bf85d34d2e |
|
25-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
conf-parser: distinguish between multiple sections with the same name
Pass on the line on which a section was decleared to the parsers, so they
can distinguish between multiple sections (if they chose to). Currently
no parsers take advantage of this, but a follow-up patch will do that
to distinguish
[Address]
Address=192.168.0.1/24
Label=one
[Address]
Address=192.168.0.2/24
Label=two
from
[Address]
Address=192.168.0.1/24
Label=one
Address=192.168.0.2/24
Label=two |
f882c247ad59776c3a7753bb963c1f8e2386cb79 |
|
17-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
networkd: make all calls async |
fe4824e065765f4536c84916694bb050c4a5d0af |
|
13-Nov-2013 |
Tom Gundersen <teg@jklm.no> |
rtnl: rename rtnl_bus_send_with_reply_and_block() to rtnl_bus_call()
Follow the equivalent rename in sd-bus to stay as similar as possible. |
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 |