summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
AgeCommit message (Collapse)Author
2015-02-03networkd: refactor socket activation a bitTom Gundersen
2015-02-03networkd: handle suspend eventsTom Gundersen
2015-02-02networkd: minor simplificationLennart Poettering
Let's return the fd we found as return value in systemd_netlink_fd(), instead of using call-by-reference.
2015-02-02networkd: support socket activationTom Gundersen
Still keep the non-socket activation code around for starting from the commandline, but will likely drop that too in the future.
2015-01-13networkd: make IP forwarding for IPv4 and IPv6 individually configurableLennart Poettering
2015-01-13networkd: introduce an AddressFamilyBoolean enum typeLennart Poettering
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.
2014-12-15networkd: failing to track links is a serious problem so log at warning ↵Tom Gundersen
level rather than debug
2014-12-08networkd: manager - enumerate addresses globally, rather than per-linkTom Gundersen
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
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.
2014-11-28treewide: more log_*_errno() conversions, multiline callsMichal Schmidt
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.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
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().
2014-11-27networkd: fix kernel rtnl receive buffer overrun errorAlin Rauta
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]
2014-11-04sd-event: rename sd_event_source_set_name() to sd_event_source_get_name()Lennart Poettering
To mirror the recent name change of the concept for sd_bus objects, follow the same logic for sd_event_source objects, too.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
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.
2014-09-13networkd: remove vestigial event sourcesDave Reisner
187fe1db took advantage of floating events, but didn't remove pointers it made superfluous.
2014-08-28sd-event: name event sources used in librariesTom Gundersen
This should help in debugging failing event sources.
2014-08-15sd-network: add system-wide sd_network_get_domains() APILennart Poettering
2014-08-13sd-network: rename operstates 'down' -> 'off' and 'up' -> 'no-carrier'Tom Gundersen
Suggested by Lennart and Kay.
2014-08-12sd-network: split the operstate 'unknown' into 'down' and 'up'Tom Gundersen
2014-08-12networkd: split out networkd-link.hTom Gundersen
2014-08-12networkd: expose a global list of DNS and NTP servers in the state fileLennart Poettering
2014-08-12networkd: update manager_save() to use fflush_and_check() to simplify things ↵Lennart Poettering
a bit
2014-07-28networkd: store ifindex as intTom Gundersen
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.