From: Ben Pfaff Date: Tue, 30 Dec 2008 20:34:39 +0000 (-0800) Subject: Force DP_GENL_A_DP_NAME and DP_GENL_A_PORTNAME to be null-terminated. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4e93fd7ae79b95bbedf2fc235be4416e64e1a8c;p=openvswitch 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. --- 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)