summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev-bond.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-06-24 13:27:34 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-06-24 13:46:15 +0200
commitdd906398dd0aa8582bdba519a2026278359c2888 (patch)
tree46af83a85fdbe052f8a86fcceac6f253f534424e /src/network/networkd-netdev-bond.h
parent846a6b3d89aaf4ee2cece0f10148f675c4796841 (diff)
sd-netlink: don't export internal type-system details
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.
Diffstat (limited to 'src/network/networkd-netdev-bond.h')
-rw-r--r--src/network/networkd-netdev-bond.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-netdev-bond.h b/src/network/networkd-netdev-bond.h
index 32d1702d58..9991fa731f 100644
--- a/src/network/networkd-netdev-bond.h
+++ b/src/network/networkd-netdev-bond.h
@@ -25,6 +25,12 @@ typedef struct Bond Bond;
#include "networkd-netdev.h"
+/*
+ * Maximum number of targets supported by the kernel for a single
+ * bond netdev.
+ */
+#define NETDEV_BOND_ARP_TARGETS_MAX 16
+
typedef enum BondMode {
NETDEV_BOND_MODE_BALANCE_RR,
NETDEV_BOND_MODE_ACTIVE_BACKUP,