summaryrefslogtreecommitdiff
path: root/src/network
AgeCommit message (Collapse)Author
2015-06-24sd-netlink: don't export internal type-system detailsDavid Herrmann
The kernel bonding layer allows passing an array of ARP IP targets as bond-configuration. Due to the weird implementation of arrays in netlink (which we haven't figure out a generic way to support, yet), we usually hard-code the supported array-sizes. However, this should not be exported from sd-netlink. Instead, make sure the caller just uses it's current hack of enumerating the types, and the sd-netlink core will have it's own list of supported array-sizes (to be removed in future extensions, btw!). If either does not match, we will just return a normal error. Note that we provide 2 constants for ARP_IP_TARGETS_MAX now. However, both have very different reasons: - the constant in netdev-bond.c is used to warn the user that the given number of targets might not be supported by the kernel (even though the kernel might increase that number at _any_ time) - the constant in sd-netlink is solely used due to us missing a proper array implementation. Once that's supported in the type-system, it can be removed without notice Last but not least, this patch turns the log_error() into a log_warning(). Given that the previous condition was off-by-one, anyway, it never hit at the right time. Thus, it was probably of no real use.
2015-06-19networkd: vlan improve loggingSusant Sahani
Replaces strerror() usage with log_netdev_error_errno()
2015-06-15everywhere: port everything to sigprocmask_many() and friendsLennart Poettering
This ports a lot of manual code over to sigprocmask_many() and friends. Also, we now consistly check for sigprocmask() failures with assert_se(), since the call cannot realistically fail unless there's a programming error. Also encloses a few sd_event_add_signal() calls with (void) when we ignore the return values for it knowingly.
2015-06-15firewall: rename fw-util.[ch] → firewall-util.[ch]Daniel Mack
The names fw-util.[ch] are too ambiguous, better rename the files to firewall-util.[ch]. Also rename the test accordingly.
2015-06-14Merge pull request #183 from ssahani/netDavid Herrmann
Improve tun/tap logging by using the new log_*errno*() functions that set 'errno' explicitly. Also fix a bunch of incorrect errno/r confusions.
2015-06-14networkd: tuntap improve loggingSusant Sahani
Replaces strerror() usage with log_netdev_error_errno()
2015-06-13sd-netlink: rename from sd-rtnlTom Gundersen
2015-06-12Merge pull request #173 from mischief/ipforwarding-3Lennart Poettering
IPForwarding=kernel v3
2015-06-11networkd: create "kernel" setting for IPForwardingNick Owens
In 5a8bcb674f71a20e95df55319b34c556638378ce, IPForwarding was introduced to set forwarding flags on interfaces in .network files. networkd sets forwarding options regardless of the previous setting, even if it was set by e.g. sysctl. This commit creates a new option for IPForwarding, "kernel", that preserves the sysctl settings rather than always setting them. See https://bugs.freedesktop.org/show_bug.cgi?id=89509 for the initial bug report.
2015-06-11Merge pull request #171 from teg/rtnl-broadcast-2David Herrmann
sd-rtnl: make joining broadcast groups implicit
2015-06-11sd-rtnl: make joining broadcast groups implicitTom Gundersen
2015-06-11Merge pull request #143 from teg/networkd-packets-per-slave-modeLennart Poettering
networkd: bond - only set packets_per_slave on balance-rr mode
2015-06-11networkd: improve loggingSusant Sahani
Replace strerror() usage with log_netdev_error_errno()
2015-06-11networkd: macvlan improve loggingSusant Sahani
Replace strerror() usage with log_netdev_error_errno()
2015-06-10libsystemd-network: use domain validation instead of hostname validation for ↵Nick Owens
dhcp domain option previously hostname_is_valid was used to validate domain names, which would silently drop perfectly valid dns names that were longer than a single dns label.
2015-06-10networkd: bond - only set packets_per_slave on balance-rr modeTom Gundersen
Otherwise the creation of the bond fails.
2015-06-10Merge pull request #132 from ssahani/bondLennart Poettering
networkd: bond improve logging
2015-06-10Merge pull request #138 from ↵Lennart Poettering
utezduyar/use-async-convenience-function-on-setting-hostname networkd: use async convenience call to set hostname
2015-06-10networkd: use async convenience call to set hostnameUmut Tezduyar Lindskog
2015-06-10network: veth imprve loggingSusant Sahani
Replaces a lof of strerror() usage with log_netdev_error_errno()
2015-06-10networkd: vxlan improve loggingSusant Sahani
Replaces a lof of strerror() usage with log_netdev_error_errno()
2015-06-10networkd: bond improve loggingSusant Sahani
Replaces a lof of strerror() usage with log_netdev_error_errno()
2015-06-09Merge pull request #113 from mezcalero/address-familyLennart Poettering
networkd: actually always use AddressFamilyBoolean as the bit mask it is
2015-06-09networkd: actually always use AddressFamilyBoolean as the bit mask it isLennart Poettering
2015-06-08Merge pull request #108 from phomes/masterLennart Poettering
tree-wide: remove spurious space
2015-06-08Revert "networkd: create "kernel" setting for IPForwarding"Lennart Poettering
2015-06-08tree-wide: remove spurious spaceThomas Hindoe Paaboel Andersen
2015-06-02networkd: create "kernel" setting for IPForwardingNick Owens
In 5a8bcb674f71a20e95df55319b34c556638378ce, IPForwarding was introduced to set forwarding flags on interfaces in .network files. networkd sets forwarding options regardless of the previous setting, even if it was set by e.g. sysctl. This commit creates a new option for IPForwarding, "kernel", that preserves the sysctl settings rather than always setting them. See https://bugs.freedesktop.org/show_bug.cgi?id=89509 for the initial bug report.
2015-05-30networkctl: fix uninitialized variableRonny Chevalier
We ignore the return value of sd_device_get_devtype, then devtype could be uninitialized when used with streq_ptr. So we need to initialize it first.
2015-05-29util: split out signal-util.[ch] from util.[ch]Lennart Poettering
No functional changes.
2015-05-25networkd: fix IFF_UP when ipv6 support is disabledTom Gundersen
Passing ipv6 options (even when they should be noops) caused IFF_UP to fail when ipv6 was supported. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90103
2015-05-18util: split all hostname related calls into hostname-util.cLennart Poettering
2015-05-15networkd: don't try to turn on ipv6 forwarding if kernel lacks IPv6 supportLennart Poettering
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031598.html
2015-05-15networkd: don't touch global forwarding settingBenedikt Morbach
This reverts commit 43c6d5abacaebf813845934ec8d5e5ee3c431854 (and a small part of 4046d8361c55c80ab8577aea52523b9e6eab0d0c) It turns out we don't actually need to set the global ip_forward setting. The only relevant setting is the one on each interface. What the global toggle actually does is switch forwarding on/off for all currently present interfaces and change the default for new ones. That means that by setting the global ip_forward we - Introduce a race condition, because if the interface with IPForward=yes is brought up after one with IPForward=no, both will have forwarding enabled, because the global switch turns it on for all interfaces. If the other interface comes up first networkd correctly sets forward=0 and it doesn't get overridden. - Change the forwarding setting for interfaces that networkd is not configured to touch, even if the user disabled forwarding via sysctl, either globally or per-interface As forwarding works fine without this, as long as all relevant interfacest individually set IPForward=yes: just drop it This means that non-networkd interfaces use the global default while networkd interfaces default to off if IPForward isn't given.
2015-05-13networkd: remove dead initializationThomas Hindoe Paaboel Andersen
2015-05-12networkd: network_get - allow udev_device to be NULLTom Gundersen
In containers we never have udev devices, so drop the assert. This fixes an assertion introduced in af3aa302741b6edb0729925febb5f8bc26721fe3.
2015-05-11core,network: major per-object logging reworkLennart Poettering
This changes log_unit_info() (and friends) to take a real Unit* object insted of just a unit name as parameter. The call will now prefix all logged messages with the unit name, thus allowing the unit name to be dropped from the various passed romat strings, simplifying invocations drastically, and unifying log output across messages. Also, UNIT= vs. USER_UNIT= is now derived from the Manager object attached to the Unit object, instead of getpid(). This has the benefit of correcting the field for --test runs. Also contains a couple of other logging improvements: - Drops a couple of strerror() invocations in favour of using %m. - Not only .mount units now warn if a symlinks exist for the mount point already, .automount units do that too, now. - A few invocations of log_struct() that didn't actually pass any additional structured data have been replaced by simpler invocations of log_unit_info() and friends. - For structured data a new LOG_UNIT_MESSAGE() macro has been added, that works like LOG_MESSAGE() but prefixes the message with the unit name. Similar, there's now LOG_LINK_MESSAGE() and LOG_NETDEV_MESSAGE(). - For structured data new LOG_UNIT_ID(), LOG_LINK_INTERFACE(), LOG_NETDEV_INTERFACE() macros have been added that generate the necessary per object fields. The old log_unit_struct() call has been removed in favour of these new macros used in raw log_struct() invocations. In addition to removing one more function call this allows generated structured log messages that contain two object fields, as necessary for example for network interfaces that are joined into another network interface, and whose messages shall be indexed by both. - The LOG_ERRNO() macro has been removed, in favour of log_struct_errno(). The latter has the benefit of ensuring that %m in format strings is properly resolved to the specified error number. - A number of logging messages have been converted to use log_unit_info() instead of log_info() - The client code in sysv-generator no longer #includes core code from src/core/. - log_unit_full_errno() has been removed, log_unit_full() instead takes an errno now, too. - log_unit_info(), log_link_info(), log_netdev_info() and friends, now avoid double evaluation of their parameters
2015-05-04network: Implement fallback DHCPv6 prefix handling for older kernelsPatrik Flykt
When setting IPv6 addresses acquired by DHCPv6, systemd-networkd sets the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. As the flag and the attribute are present starting with Linux 3.14, older kernels will need systemd-network to manage prefix route expiry. By default, DHCPv6 addresses are first assigned setting the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. Should the address assignment fail, the same assignment is tried without the IFA_FLAGS attribute. Should also the second attempt fail, an error is printed and address assignment ends with failure. As successful use of the IFA_FLAGS netlink attribute is recorded in the Link structure, the DHCPv6 code will know if the kernel or systemd-network fallback code handles expiring prefixes. The prefix expiration and IPv6 address updating fallback code is resurrected from the parts deleted with commit 47d45d3cde45d6545367570264e4e3636bc9e345. This patch can be removed once the minimum kernel requirements are greater than or equal to 3.14.
2015-04-29networkd: introduce vti6 tunnelSusant Sahani
This patch add support to create vti6 tunnel test: vt6.network [Match] Name=wlan0 [Network] Tunnel=ip6vti vti6.netdev [NetDev] Name=ip6vti Kind=vti6 [Tunnel] Local=2a00:ffde:4567:edde::4987 Remote=2001:473:fece:cafe::5179 ip link 11: ip6_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 :: brd :: 12: ip6vti@wlan0: <POINTOPOINT,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
2015-04-29networkd: tunnel improve loggingSusant Sahani
Replaces a lof ot strerror() usage with log_netdev_error_errno()
2015-04-29sd-bus: drop bus parameter from message callback prototypeLennart Poettering
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
2015-04-21networkd-fdb: indentation/whitespace fixesLennart Poettering
2015-04-21networkd: improve how networkd logs thingsLennart Poettering
This makes adds a couple of fixes: - Introduces log_netdev_error_errno() and friends, which takes an error number, and matches what log_link_error_errno() and friends do. - Replaces a lof ot strerror() usage with log_netdev_error_errno(), log_link_error_errno() and log_erro_errno() - Uppercases the first character of many log messages, after all this is supposed to be english language - Drops manual negating of error codes before passing them to log functions, the log functions all do that internally anyway. Some other minor fixes. Behaviour should not change really.
2015-04-21networkd man: fix man and config name.Susant Sahani
Rename bond confs and man as well. [tomegun: dropped a stray comma]
2015-04-21networkd: fix confusion between log_netdev_error() but log_warning_netdev()Lennart Poettering
We should always name the object first, the level second, like everywhere else in the sources.
2015-04-20networkd: Add support for bond option.Susant Sahani
This patch adds configurational support for bond option. Test conf: bond.netdev --- [NetDev] Name=bond1 Kind=bond [Bond] ArpAllTargets=all PrimaryReselect=better ArpIntervalSec=10s ArpIpTargets= 192.168.8.102 192.168.8.101 192.168.8.102 --- $cat /proc/net/bonding/bond1 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: load balancing (round-robin) MII Status: up MII Polling Interval (ms): 0 Up Delay (ms): 0 Down Delay (ms): 0 ARP Polling Interval (ms): 10000 ARP IP target/s (n.n.n.n form): 192.168.8.100, 192.168.8.101, 192.168.8.102
2015-04-20networkd vxlan: Add support for enabling UDP checksumsSusant Sahani
Add UDPCheckSum option to enable transmitting UDP checksums when doing VXLAN/IPv4. Add UDP6ZeroChecksumRx, and UDP6ZeroChecksumTx options to enable sending zero checksums and receiving zero checksums in VXLAN/IPv6 [tomegun: rebase manpage due to whitespace changes]
2015-04-11shared: add terminal-util.[ch]Ronny Chevalier
2015-04-09networkd: do not assign the variable twiceThomas Hindoe Paaboel Andersen
2015-04-03networkd: improve logging when processing links and addressesTom Gundersen