summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
AgeCommit message (Collapse)Author
2014-02-22networkd: handle SIGINT and SIGTERMTom Gundersen
2014-02-20api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering
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.
2014-02-18networkd: refactor link_add() ↵Tom Gundersen
:( 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>
2014-02-13networkd: correctly handle manager_free(NULL)Tom Gundersen
2014-02-12networkd: work inside containersTom Gundersen
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.
2014-02-07networkd: netdev - rename Netdev to NetDevTom Gundersen
Both in the configuration file format and everywhere else in the code.
2014-02-07sd-dhcp-client: split sd_dhcp_lease from sd_dhcp_clientTom Gundersen
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.
2014-01-30networkd: netdev - reduce chance of race when receiving netdev's ifindexTom Gundersen
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.
2014-01-22networkd: add basic bonding supportTom Gundersen
Refactor bridging support to be generic netdev support and extend it to cover bonding as well.
2014-01-18sd-dhcp-client/networkd: add domainname supportTom Gundersen
2014-01-18networkd: don't hard depend on system busTom Gundersen
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.
2014-01-18networkd: resolv.conf - reword commentTom Gundersen
Take into account that users may want to use resolvconf(8), or similar. Also, avoid repeated calls to fputs().
2014-01-16networkd: resolv.conf - extend the comment a bitTom Gundersen
2014-01-16sd-dhcp-client: refactor DNS supportTom Gundersen
Rather than keeping an array of pointers to addresses, just keep an array of addresses.
2014-01-16sd-dhcp-client/networkd: add transient hostname supportTom Gundersen
2014-01-12networkd: fix wordingTom Gundersen
2014-01-12networkd: generate resolv.confTom Gundersen
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.
2014-01-08No need to canonicalize fixed pathsZbigniew Jędrzejewski-Szmek
2014-01-03networkd: link hash uses 64, not 32 bit keysTom Gundersen
2014-01-03networkd: print the ifindex of added linksTom Gundersen
This debug information may be useful when comapring to dropped rtnetlink messages.
2014-01-03networkd: improve loggingTom Gundersen
This gives a bit better messages when a link is added twice.
2014-01-03networkd: add some debug info about notifications we ignoreTom Gundersen
2014-01-02networkd: only track state of links we are managingTom Gundersen
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-02networkd: improve loggingTom Gundersen
Remove redundant messages, add some debugging ones and make wording more uniform.
2013-12-18core,logind,networkd: check for udev device initialization via enumeration ↵Lennart Poettering
matches Instead of checking each device after we got it, check wuth an enumeration filter instead, to make it more efficient.
2013-12-18core,logind,networkd: don't pick up devices from udev before they finished ↵Lennart Poettering
udev initialization Managers shouldn't pick up the devices the manage before udev finished initialization, hence check explicitly for that.
2013-12-17networkd: rename link_update_flags to link_updateTom Gundersen
We are likely to track more than the flags in the future.
2013-12-13event: be more conservative when returning errors from event handler callbacksLennart Poettering
We really should return errors from event handlers if we have a continous problem and don't know any other solution.
2013-12-11event: hook up sd-event with the service watchdog logicLennart Poettering
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-04networkd: add link-sense and simplify state-machine a bitTom Gundersen
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-11-26networkd: add bridge supportTom Gundersen
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-21networkd: don't filter on udev tagsTom Gundersen
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-19networkd: make sure Links and Networks are freedTom Gundersen
2013-11-17networkd: make all calls asyncTom Gundersen
2013-11-12bus: introduce concept of a "default" event loop per-thread and make use of ↵Lennart Poettering
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-09networkd: add a basic network daemonTom Gundersen
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