Skip to content

Commit

Permalink
config: Define OVS_CT_EVENT_* mask macros.
Browse files Browse the repository at this point in the history
Unconditionally define OVS_CT_EVENT_* macros for the datapath netlink
interface so that we do not need to include platform dependent files.
This fixes the build on non-Linux (and non-Windows) platforms.

Also define a macro for the default set of events set by OVS userspace.

Reported-by: Joe Stringer <[email protected]>
Signed-off-by: Jarno Rajahalme <[email protected]>
Acked-by: Joe Stringer <[email protected]>
  • Loading branch information
Jarno Rajahalme committed Apr 29, 2017
1 parent d5c1c98 commit 975954a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 17 additions & 2 deletions build-aux/extract-odp-netlink-h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,24 @@ $i\
#ifdef _WIN32\
#include "OvsDpInterfaceExt.h"\
#include "OvsDpInterfaceCtExt.h"\
#else\
#include "linux/netfilter/nf_conntrack_common.h"\
#endif\
\
/* IPCT_* enums may not be defined in all platforms, so do not use them. */\
#define OVS_CT_EVENT_NEW (1 << 0) /* 1 << IPCT_NEW */\
#define OVS_CT_EVENT_RELATED (1 << 1) /* 1 << IPCT_RELATED */\
#define OVS_CT_EVENT_DESTROY (1 << 2) /* 1 << IPCT_DESTROY */\
#define OVS_CT_EVENT_REPLY (1 << 3) /* 1 << IPCT_REPLY */\
#define OVS_CT_EVENT_ASSURED (1 << 4) /* 1 << IPCT_ASSURED */\
#define OVS_CT_EVENT_PROTOINFO (1 << 5) /* 1 << IPCT_PROTOINFO */\
#define OVS_CT_EVENT_HELPER (1 << 6) /* 1 << IPCT_HELPER */\
#define OVS_CT_EVENT_MARK (1 << 7) /* 1 << IPCT_MARK */\
#define OVS_CT_EVENT_SEQADJ (1 << 8) /* 1 << IPCT_SEQADJ */\
#define OVS_CT_EVENT_SECMARK (1 << 9) /* 1 << IPCT_SECMARK */\
#define OVS_CT_EVENT_LABEL (1 << 10) /* 1 << IPCT_LABEL */\
\
#define OVS_CT_EVENTMASK_DEFAULT \\\
(OVS_CT_EVENT_NEW | OVS_CT_EVENT_RELATED | OVS_CT_EVENT_DESTROY |\\\
OVS_CT_EVENT_MARK | OVS_CT_EVENT_LABEL)\

# Use OVS's own struct eth_addr instead of a 6-byte char array.
s,<linux/types\.h>,"openvswitch/types.h"\
Expand Down
4 changes: 1 addition & 3 deletions ofproto/ofproto-dpif-xlate.c
Original file line number Diff line number Diff line change
Expand Up @@ -5363,9 +5363,7 @@ compose_conntrack_action(struct xlate_ctx *ctx, struct ofpact_conntrack *ofc)
OVS_CT_ATTR_FORCE_COMMIT : OVS_CT_ATTR_COMMIT);
if (ctx->xbridge->support.ct_eventmask) {
nl_msg_put_u32(ctx->odp_actions, OVS_CT_ATTR_EVENTMASK,
1 << IPCT_NEW | 1 << IPCT_RELATED |
1 << IPCT_DESTROY | 1 << IPCT_MARK |
1 << IPCT_LABEL);
OVS_CT_EVENTMASK_DEFAULT);
}
}
nl_msg_put_u16(ctx->odp_actions, OVS_CT_ATTR_ZONE, zone);
Expand Down

0 comments on commit 975954a

Please sign in to comment.