/*
- * Copyright (c) 2009, 2010 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
[IFLA_ADDRESS] = { .type = NL_A_UNSPEC, .optional = true },
};
- static struct nlattr *attrs[ARRAY_SIZE(policy)];
+ struct nlattr *attrs[ARRAY_SIZE(policy)];
parsed = nl_policy_parse(buf, NLMSG_HDRLEN + sizeof(struct ifinfomsg),
policy, attrs, ARRAY_SIZE(policy));
const struct ifinfomsg *ifinfo;
nlmsg = buf->data;
- ifinfo = ((const struct ifinfomsg *)
- ((const char *) buf->data + NLMSG_HDRLEN));
+ ifinfo = ofpbuf_at(buf, NLMSG_HDRLEN, sizeof *ifinfo);
change->nlmsg_type = nlmsg->nlmsg_type;
change->ifi_index = ifinfo->ifi_index;