git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0dfd1cb
)
odp-util: Use nl_parse_nested() to simplify format_odp_sample_action().
author
Ben Pfaff
<blp@nicira.com>
Tue, 4 Oct 2011 19:58:25 +0000
(12:58 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Wed, 5 Oct 2011 18:17:14 +0000
(11:17 -0700)
lib/odp-util.c
patch
|
blob
|
history
diff --git
a/lib/odp-util.c
b/lib/odp-util.c
index
d97d30c
..
7f5158f
100644
(file)
--- a/
lib/odp-util.c
+++ b/
lib/odp-util.c
@@
-98,16
+98,13
@@
format_odp_sample_action(struct ds *ds, const struct nlattr *attr)
[OVS_SAMPLE_ATTR_ACTIONS] = { .type = NL_A_NESTED }
};
struct nlattr *a[ARRAY_SIZE(ovs_sample_policy)];
[OVS_SAMPLE_ATTR_ACTIONS] = { .type = NL_A_NESTED }
};
struct nlattr *a[ARRAY_SIZE(ovs_sample_policy)];
- struct ofpbuf buf;
double percentage;
const struct nlattr *nla_acts;
int len;
ds_put_cstr(ds, "sample");
double percentage;
const struct nlattr *nla_acts;
int len;
ds_put_cstr(ds, "sample");
- ofpbuf_use_const(&buf, nl_attr_get(attr), nl_attr_get_size(attr));
- if (!nl_policy_parse(&buf, 0, ovs_sample_policy, a,
- ARRAY_SIZE(ovs_sample_policy))) {
+ if (!nl_parse_nested(attr, ovs_sample_policy, a, ARRAY_SIZE(a))) {
ds_put_cstr(ds, "(error)");
return;
}
ds_put_cstr(ds, "(error)");
return;
}