X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frtnetlink-link.c;h=1c12562c5af7437cc24d32ec46b49e719b96854a;hb=28c5588e8e1a8d091c5d2275232c35f2968a97fa;hp=07350a6c5a54f52be8b219018b236f0dad17c7dd;hpb=44445cac40bec2b2f12e8baf7bbb7fcf32fcbb42;p=sliver-openvswitch.git diff --git a/lib/rtnetlink-link.c b/lib/rtnetlink-link.c index 07350a6c5..1c12562c5 100644 --- a/lib/rtnetlink-link.c +++ b/lib/rtnetlink-link.c @@ -1,5 +1,5 @@ /* - * 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. @@ -49,7 +49,7 @@ rtnetlink_link_parse(struct ofpbuf *buf, [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)); @@ -58,9 +58,8 @@ rtnetlink_link_parse(struct ofpbuf *buf, const struct nlmsghdr *nlmsg; const struct ifinfomsg *ifinfo; - nlmsg = buf->data; - ifinfo = ((const struct ifinfomsg *) - ((const char *) buf->data + NLMSG_HDRLEN)); + nlmsg = ofpbuf_data(buf); + ifinfo = ofpbuf_at(buf, NLMSG_HDRLEN, sizeof *ifinfo); change->nlmsg_type = nlmsg->nlmsg_type; change->ifi_index = ifinfo->ifi_index;