Fix problem in sending netlink messages on non-32-bit platforms.
authorroot <root@salsa.nicira.com>
Thu, 24 Apr 2008 18:37:54 +0000 (11:37 -0700)
committerroot <root@salsa.nicira.com>
Thu, 24 Apr 2008 18:37:54 +0000 (11:37 -0700)
** Fix provided by Ben. **

lib/dpif.c

index 63611e9367bb77037abde93166b30c81244a6135..08c83c713aa1f411132d1be491edd71129ff32f4 100644 (file)
@@ -203,8 +203,8 @@ dpif_send_openflow(struct dpif *dp, struct buffer *buffer, bool wait)
     nl_msg_put_genlmsghdr(&hdr, dp->sock, 32, openflow_family,
                           NLM_F_REQUEST, DP_GENL_C_OPENFLOW, 1);
     nl_msg_put_u32(&hdr, DP_GENL_A_DP_IDX, dp->dp_idx);
-    nla = buffer_put_uninit(&hdr, sizeof nla);
-    nla->nla_len = sizeof nla + buffer->size;
+    nla = buffer_put_uninit(&hdr, sizeof *nla);
+    nla->nla_len = sizeof *nla + buffer->size;
     nla->nla_type = DP_GENL_A_OPENFLOW;
     pad_bytes = NLA_ALIGN(nla->nla_len) - nla->nla_len;
     nl_msg_nlmsghdr(&hdr)->nlmsg_len = hdr.size + buffer->size + pad_bytes;