Commit graph

365 commits

Author SHA1 Message Date
Tom Gundersen d0d311d62f networkd: add some debug info about notifications we ignore 2014-01-03 16:02:12 +01:00
Tom Gundersen 06a6e59301 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).
2014-01-02 15:56:10 +01:00
Tom Gundersen 449f755492 networkd: improve logging
Remove redundant messages, add some debugging ones and make wording more uniform.
2014-01-02 15:49:23 +01:00
Lennart Poettering e120204729 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.
2013-12-18 18:21:28 +01:00
Lennart Poettering bf5332d2bf 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.
2013-12-18 03:37:26 +01:00
Tom Gundersen 22936833e1 networkd: rename link_update_flags to link_update
We are likely to track more than the flags in the future.
2013-12-17 22:08:12 +01:00
Lennart Poettering 7b77ed8cf3 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.
2013-12-13 04:06:43 +01:00
Lennart Poettering cde93897cd 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.
2013-12-11 18:20:09 +01:00
Tom Gundersen dd3efc0993 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.
2013-12-04 14:15:13 +01:00
Tom Gundersen 02b59d57e0 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.
2013-11-26 01:32:25 +01:00
Tom Gundersen 002f5de9a9 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.
2013-11-21 15:33:02 +01:00
Tom Gundersen 0617ffabe8 networkd: make sure Links and Networks are freed 2013-11-19 14:39:19 +01:00
Tom Gundersen f882c247ad networkd: make all calls async 2013-11-17 23:12:27 +01:00
Lennart Poettering afc6adb5ec 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()".
2013-11-12 00:12:43 +01:00
Tom Gundersen f579559b3a 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
2013-11-09 23:41:17 +01:00