projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofp-print: Do not display flow mod cookie if it is UINT64_MAX
[openvswitch]
/
lib
/
odp-util.c
diff --git
a/lib/odp-util.c
b/lib/odp-util.c
index 8693d3c81baf635d64b789ec20bd6ec85c0141e7..257d7a7accee67434dd9123ef9ac5bda7836db2f 100644
(file)
--- a/
lib/odp-util.c
+++ b/
lib/odp-util.c
@@
-14,8
+14,8
@@
* limitations under the License.
*/
* limitations under the License.
*/
-#include <arpa/inet.h>
#include <config.h>
#include <config.h>
+#include <arpa/inet.h>
#include "odp-util.h"
#include <errno.h>
#include <inttypes.h>
#include "odp-util.h"
#include <errno.h>
#include <inttypes.h>
@@
-1246,7
+1246,10
@@
ovs_to_odp_frag(uint8_t nw_frag)
: OVS_FRAG_TYPE_LATER);
}
: OVS_FRAG_TYPE_LATER);
}
-/* Appends a representation of 'flow' as OVS_KEY_ATTR_* attributes to 'buf'. */
+/* Appends a representation of 'flow' as OVS_KEY_ATTR_* attributes to 'buf'.
+ *
+ * 'buf' must have at least ODPUTIL_FLOW_KEY_BYTES bytes of space, or be
+ * capable of being expanded to allow for that much space. */
void
odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow)
{
void
odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow)
{
@@
-1257,8
+1260,8
@@
odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow)
nl_msg_put_u32(buf, OVS_KEY_ATTR_PRIORITY, flow->skb_priority);
}
nl_msg_put_u32(buf, OVS_KEY_ATTR_PRIORITY, flow->skb_priority);
}
- if (flow->tun_id != htonll(0)) {
- nl_msg_put_be64(buf, OVS_KEY_ATTR_TUN_ID, flow->tun_id);
+ if (flow->tun
nel.tun
_id != htonll(0)) {
+ nl_msg_put_be64(buf, OVS_KEY_ATTR_TUN_ID, flow->tun
nel.tun
_id);
}
if (flow->in_port != OFPP_NONE && flow->in_port != OFPP_CONTROLLER) {
}
if (flow->in_port != OFPP_NONE && flow->in_port != OFPP_CONTROLLER) {
@@
-1750,7
+1753,7
@@
odp_flow_key_to_flow(const struct nlattr *key, size_t key_len,
}
if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUN_ID)) {
}
if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUN_ID)) {
- flow->tun_id = nl_attr_get_be64(attrs[OVS_KEY_ATTR_TUN_ID]);
+ flow->tun
nel.tun
_id = nl_attr_get_be64(attrs[OVS_KEY_ATTR_TUN_ID]);
expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_TUN_ID;
}
expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_TUN_ID;
}
@@
-1845,13
+1848,13
@@
static void
commit_set_tun_id_action(const struct flow *flow, struct flow *base,
struct ofpbuf *odp_actions)
{
commit_set_tun_id_action(const struct flow *flow, struct flow *base,
struct ofpbuf *odp_actions)
{
- if (base->tun
_id == flow->
tun_id) {
+ if (base->tun
nel.tun_id == flow->tunnel.
tun_id) {
return;
}
return;
}
- base->tun
_id = flow->
tun_id;
+ base->tun
nel.tun_id = flow->tunnel.
tun_id;
commit_set_action(odp_actions, OVS_KEY_ATTR_TUN_ID,
commit_set_action(odp_actions, OVS_KEY_ATTR_TUN_ID,
- &base->tun
_id, sizeof(base->
tun_id));
+ &base->tun
nel.tun_id, sizeof(base->tunnel.
tun_id));
}
static void
}
static void
@@
-1973,7
+1976,7
@@
static void
commit_set_port_action(const struct flow *flow, struct flow *base,
struct ofpbuf *odp_actions)
{
commit_set_port_action(const struct flow *flow, struct flow *base,
struct ofpbuf *odp_actions)
{
- if (!base->tp_src
||
!base->tp_dst) {
+ if (!base->tp_src
&&
!base->tp_dst) {
return;
}
return;
}