From f4e93fd7ae79b95bbedf2fc235be4416e64e1a8c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 30 Dec 2008 12:34:39 -0800 Subject: [PATCH] Force DP_GENL_A_DP_NAME and DP_GENL_A_PORTNAME to be null-terminated. The kernel doesn't check for a null terminator on strings in Netlink attributes unless you force it to do so. --- datapath/datapath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index a98a98fe..d9184b65 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1099,9 +1099,9 @@ static struct genl_family dp_genl_family = { /* Attribute policy: what each attribute may contain. */ static struct nla_policy dp_genl_policy[DP_GENL_A_MAX + 1] = { [DP_GENL_A_DP_IDX] = { .type = NLA_U32 }, - [DP_GENL_A_DP_NAME] = { .type = NLA_STRING }, + [DP_GENL_A_DP_NAME] = { .type = NLA_NUL_STRING }, [DP_GENL_A_MC_GROUP] = { .type = NLA_U32 }, - [DP_GENL_A_PORTNAME] = { .type = NLA_STRING } + [DP_GENL_A_PORTNAME] = { .type = NLA_NUL_STRING } }; static int dp_genl_add(struct sk_buff *skb, struct genl_info *info) -- 2.30.2