From: Justin Pettit Date: Thu, 17 Apr 2008 01:26:47 +0000 (-0700) Subject: Fix a problem with not allocating enough room for netlink messages. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30217c8a48d36ffe05c31813d0d84808f2118f78;p=openvswitch Fix a problem with not allocating enough room for netlink messages. --- 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) {