summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
AgeCommit message (Collapse)Author
2014-07-18change type for address family to "int"Lennart Poettering
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.
2014-07-18sd-rtnl: make string returned by sd_rtnl_message_read_string() constLennart Poettering
2014-07-14networkd: netdev - introduce vtable for netdev kindsTom Gundersen
Split each netdev kind into its own .h/.c.
2014-07-07networkd: simplify signal handling of SIGTERM/SIGINTLennart Poettering
sd-event makes handling SIGTERM/SIGINT a lot easier than it used to, let's make use of this
2014-07-01networkd: link - ignore missing MAC addressTom Gundersen
Currently DHCP/IPv4LL only works on ethernet devices, but no reason not to otherwise manage them.
2014-07-01networkd: link - improve refcountingTom Gundersen
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>.
2014-06-18networkd: add address pool supportLennart Poettering
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.
2014-06-03networkd: split runtime config dir from state dirTom Gundersen
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.
2014-06-03networkd: drop CAP_SYS_MODULETom Gundersen
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.
2014-05-19networkd/sd-network: extend operational statesTom Gundersen
Expose states 'degraded' or 'routable' if a link has a site/link-local or a routable address, respectively.
2014-05-19resolved: add daemon to manage resolv.confTom Gundersen
Also remove the equivalent functionality from networkd.
2014-05-16networkd: manager - read fallback DNS servers from config fileTom Gundersen
We will still use the compiled-in defaults if no DNS entry exists in the config file.
2014-05-16networkd: network - store DNS servers in List rather than SetTom Gundersen
This way we preserve the order of preference.
2014-05-16networkd: hardcode a set of default dns serversTom Gundersen
Similarly to NTP servers, this can be set at compile-time.
2014-05-12networkd: manager - don't leak kmod contextTom Gundersen
Also, keep the kmod_new internal to networkd-manager.c
2014-05-12networkd: introduce ipip tunnelSusant Sahani
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]
2014-05-11networkd: get preexiting addresses when a link is addedTom Gundersen
2014-05-10networkd: listen for address changesTom Gundersen
This is proof-of-concept only, as we only log the changes but don't do anything with it.
2014-05-10rtnl: change from bitmask to enum for rtnl groupsTom Gundersen
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.
2014-05-10networkd: manager - initialize variablesTom Gundersen
2014-05-10networkd: manager - refactor link tracking a bitTom Gundersen
2014-05-09networkd: manager - drop links and netdevs when we receive DELLINKTom Gundersen
2014-05-09networkd: introduce refcounting for Links and NetDevsTom Gundersen
2014-05-08sd-network: expose global operational stateTom Gundersen
2014-04-19networkd: manager - add a bit of debug output to udev ADD eventsTom Gundersen
2014-04-19networkd: tie links to rtnl rather than udevTom Gundersen
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.
2014-03-31networkd: rewind rtnl message between passing it to functionsTom Gundersen
This makes updating link status on netdev links work again.
2014-03-31networkd: fix use-after-freeTom Gundersen
Free networks before links (the reverse of creation order).
2014-03-28networkd: netdev - improve logging when setting ifindexTom Gundersen
2014-03-24networkd: netdev - verify that newlink messages has the expected kindTom Gundersen
We match 'newlink' messages with expected netdev's based on their names. Now also make sure that the receieved link has the expected kind.
2014-03-20networkd: update mac address in clients when it changesTom Gundersen
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.
2014-03-14networkd: fix typoMichael Olbrich
It's HAVE_SPLIT_USR not HAVE_SPLIT_USER
2014-03-14networkd: allow more than one static DNS serverTom Gundersen
2014-03-14networkd: fix creation of runtime dirs at startupTom Gundersen
This allows us to drop the repeated attempted creations of the runtime dirs during runtime.
2014-03-06sd-rtnl/networkd: use new rtnl_message_read() API and drop helperTom Gundersen
With the new sd_rtnl_message_read_string(), there is no longer a need for rtnl_message_get_ifname().
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