Skip to content

Commit

Permalink
ofproto-dpif-xlate: Tidy up ct_mark xlate code.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
joestringer committed Apr 22, 2016
1 parent f2d105b commit 2a754f4
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ofproto/ofproto-dpif-xlate.c
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 2a754f4

Please sign in to comment.