aboutsummaryrefslogtreecommitdiff
path: root/lib/netlink.c
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2013-07-22 15:47:19 -0700
committerBen Pfaff <blp@nicira.com>2013-07-23 12:34:41 -0700
commitdb5a101931c5393d5f9df600559882418d536878 (patch)
tree3e2820c844a3f20209736adad31ddfaa1b0f5e13 /lib/netlink.c
parent550f0db4e0fb3bf9952e8a88b71242491b9dde2a (diff)
clang: Fix the alignment warning.
This commit fixes the warning issued by 'clang' when pointer is casted to one with greater alignment. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/netlink.c')
-rw-r--r--lib/netlink.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/netlink.c b/lib/netlink.c
index a6867847..50444abd 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -711,8 +711,7 @@ nl_policy_parse(const struct ofpbuf *msg, size_t nla_offset,
return false;
}
- NL_ATTR_FOR_EACH (nla, left,
- (struct nlattr *) ((char *) msg->data + nla_offset),
+ NL_ATTR_FOR_EACH (nla, left, ofpbuf_at(msg, nla_offset, 0),
msg->size - nla_offset)
{
uint16_t type = nl_attr_type(nla);
@@ -777,8 +776,7 @@ nl_attr_find__(const struct nlattr *attrs, size_t size, uint16_t type)
const struct nlattr *
nl_attr_find(const struct ofpbuf *buf, size_t hdr_len, uint16_t type)
{
- const uint8_t *start = (const uint8_t *) buf->data + hdr_len;
- return nl_attr_find__((const struct nlattr *) start, buf->size - hdr_len,
+ return nl_attr_find__(ofpbuf_at(buf, hdr_len, 0), buf->size - hdr_len,
type);
}