2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

byte-order: Make hton128() and ntoh128() behave like their counterparts.

Instead of taking the source and destination as arguments, make these
functions act like their short and long counterparts.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Justin Pettit
2015-10-31 03:12:38 -07:00
parent 184dfff00a
commit 32ea15f6f5
5 changed files with 29 additions and 39 deletions

View File

@@ -671,7 +671,7 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
break;
case MFF_CT_LABEL:
hton128(&flow->ct_label, &value->be128);
value->be128 = hton128(flow->ct_label);
break;
CASE_MFF_REGS:
@@ -918,13 +918,9 @@ mf_set_value(const struct mf_field *mf,
match_set_ct_mark(match, ntohl(value->be32));
break;
case MFF_CT_LABEL: {
ovs_u128 label;
ntoh128(&value->be128, &label);
match_set_ct_label(match, label);
case MFF_CT_LABEL:
match_set_ct_label(match, ntoh128(value->be128));
break;
}
CASE_MFF_REGS:
match_set_reg(match, mf->id - MFF_REG0, ntohl(value->be32));
@@ -1223,7 +1219,7 @@ mf_set_flow_value(const struct mf_field *mf,
break;
case MFF_CT_LABEL:
ntoh128(&value->be128, &flow->ct_label);
flow->ct_label = ntoh128(value->be128);
break;
CASE_MFF_REGS:
@@ -1810,18 +1806,10 @@ mf_set(const struct mf_field *mf,
match_set_ct_mark_masked(match, ntohl(value->be32), ntohl(mask->be32));
break;
case MFF_CT_LABEL: {
ovs_u128 hlabel, hmask;
ntoh128(&value->be128, &hlabel);
if (mask) {
ntoh128(&mask->be128, &hmask);
} else {
hmask.u64.lo = hmask.u64.hi = UINT64_MAX;
}
match_set_ct_label_masked(match, hlabel, hmask);
case MFF_CT_LABEL:
match_set_ct_label_masked(match, ntoh128(value->be128),
mask ? ntoh128(mask->be128) : OVS_U128_MAX);
break;
}
case MFF_ETH_DST:
match_set_dl_dst_masked(match, value->mac, mask->mac);