mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
openvswitch/types.h: New macros OVS_BE16_MAX, OVS_BE32_MAX, OVS_BE64_MAX.
These seem slightly nicer than e.g. htons(UINT16_MAX). Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -544,7 +544,7 @@ parse_metadata(struct ofpbuf *b, char *arg)
|
||||
return error;
|
||||
}
|
||||
} else {
|
||||
om->mask = htonll(UINT64_MAX);
|
||||
om->mask = OVS_BE64_MAX;
|
||||
}
|
||||
|
||||
return str_to_be64(arg, &om->metadata);
|
||||
@@ -1149,7 +1149,7 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string,
|
||||
fm->cookie_mask = htonll(0);
|
||||
if (command == OFPFC_MODIFY || command == OFPFC_MODIFY_STRICT) {
|
||||
/* For modify, by default, don't update the cookie. */
|
||||
fm->new_cookie = htonll(UINT64_MAX);
|
||||
fm->new_cookie = OVS_BE64_MAX;
|
||||
} else{
|
||||
fm->new_cookie = htonll(0);
|
||||
}
|
||||
@@ -1290,7 +1290,7 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string,
|
||||
*usable_protocols &= OFPUTIL_P_NXM_OXM_ANY;
|
||||
}
|
||||
}
|
||||
if (!fm->cookie_mask && fm->new_cookie == htonll(UINT64_MAX)
|
||||
if (!fm->cookie_mask && fm->new_cookie == OVS_BE64_MAX
|
||||
&& (command == OFPFC_MODIFY || command == OFPFC_MODIFY_STRICT)) {
|
||||
/* On modifies without a mask, we are supposed to add a flow if
|
||||
* one does not exist. If a cookie wasn't been specified, use a
|
||||
|
Reference in New Issue
Block a user