[systemd-commits] src/libsystemd
Lennart Poettering
lennart at kemper.freedesktop.org
Wed Apr 8 03:57:13 PDT 2015
src/libsystemd/sd-rtnl/rtnl-types.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit de79f906ab614dd0d53129c4d4aa18a964864f39
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 8 12:53:50 2015 +0200
sd-rtnl: properly size attribute array if IFA_FLAGS was missing
diff --git a/src/libsystemd/sd-rtnl/rtnl-types.c b/src/libsystemd/sd-rtnl/rtnl-types.c
index 5ae4790..49784bf 100644
--- a/src/libsystemd/sd-rtnl/rtnl-types.c
+++ b/src/libsystemd/sd-rtnl/rtnl-types.c
@@ -348,7 +348,9 @@ static const NLTypeSystem rtnl_link_type_system = {
.types = rtnl_link_types,
};
-static const NLType rtnl_address_types[IFA_MAX + 1] = {
+/* IFA_FLAGS was defined in kernel 3.14, but we still support older
+ * kernels where IFA_MAX is lower. */
+static const NLType rtnl_address_types[CONST_MAX(IFA_MAX, IFA_FLAGS) + 1] = {
[IFA_ADDRESS] = { .type = NLA_IN_ADDR },
[IFA_LOCAL] = { .type = NLA_IN_ADDR },
[IFA_LABEL] = { .type = NLA_STRING, .size = IFNAMSIZ - 1 },
More information about the systemd-commits
mailing list