From 30217c8a48d36ffe05c31813d0d84808f2118f78 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Wed, 16 Apr 2008 18:26:47 -0700 Subject: [PATCH] Fix a problem with not allocating enough room for netlink messages. --- datapath/datapath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 8ab30011..89c57674 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -105,7 +105,8 @@ alloc_openflow_skb(struct datapath *dp, size_t openflow_len, uint8_t type, struct nlattr *attr; struct ofp_header *oh; - genl_len = nla_total_size(sizeof(uint32_t)); /* DP_GENL_A_DP_IDX */ + genl_len = nlmsg_total_size(GENL_HDRLEN + dp_genl_family.hdrsize); + genl_len += nla_total_size(sizeof(uint32_t)); /* DP_GENL_A_DP_IDX */ genl_len += nla_total_size(openflow_len); /* DP_GENL_A_OPENFLOW */ skb = *pskb = genlmsg_new(genl_len, GFP_ATOMIC); if (!skb) { -- 2.30.2