git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Fix potential leak during flow mods.
[sliver-openvswitch.git]
/
lib
/
rtnetlink-link.c
diff --git
a/lib/rtnetlink-link.c
b/lib/rtnetlink-link.c
index
0b3710f
..
1c12562
100644
(file)
--- a/
lib/rtnetlink-link.c
+++ b/
lib/rtnetlink-link.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009, 2010 Nicira, Inc.
+ * 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.
*
* 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 },
};
[IFLA_ADDRESS] = { .type = NL_A_UNSPEC, .optional = true },
};
- st
atic st
ruct 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));
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;
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;
change->nlmsg_type = nlmsg->nlmsg_type;
change->ifi_index = ifinfo->ifi_index;