summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorJoe Stringer <joe@ovn.org>2016-04-15 11:36:05 -0700
committerJoe Stringer <joe@ovn.org>2016-04-22 14:30:40 -0700
commit2a754f4a0a66c24fdc6f1997a789bcf1079aabb9 (patch)
treeae9e75b1c514b11983e3a1484972eff304a75bb8 /ofproto
parentf2d105b5915f891c4cda62847ce9d0c31e2df5fe (diff)
downloadopenvswitch-2a754f4a0a66c24fdc6f1997a789bcf1079aabb9.tar.gz
ofproto-dpif-xlate: Tidy up ct_mark xlate code.
Make the ct_mark netlink serialization more consistent with the way that ct_label is serialized. Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-xlate.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 2d0d76912..7a201bde1 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4285,17 +4285,16 @@ static void
put_ct_mark(const struct flow *flow, struct ofpbuf *odp_actions,
struct flow_wildcards *wc)
{
- struct {
- uint32_t key;
- uint32_t mask;
- } odp_attr;
-
- odp_attr.key = flow->ct_mark & wc->masks.ct_mark;
- odp_attr.mask = wc->masks.ct_mark;
-
- if (odp_attr.mask) {
- nl_msg_put_unspec(odp_actions, OVS_CT_ATTR_MARK, &odp_attr,
- sizeof(odp_attr));
+ if (wc->masks.ct_mark) {
+ struct {
+ uint32_t key;
+ uint32_t mask;
+ } *odp_ct_mark;
+
+ odp_ct_mark = nl_msg_put_unspec_uninit(odp_actions, OVS_CT_ATTR_MARK,
+ sizeof(*odp_ct_mark));
+ odp_ct_mark->key = flow->ct_mark & wc->masks.ct_mark;
+ odp_ct_mark->mask = wc->masks.ct_mark;
}
}