summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-26 09:03:03 -0700
committerBen Pfaff <blp@nicira.com>2011-05-26 09:03:03 -0700
commita75777916820892493ae797e88dafd62317c00a7 (patch)
treeec686d3d2214e6cafe40de0d61f47981515a10e1 /ofproto
parentee693ba0850c5201830f22c645f6c5a06fa4180e (diff)
downloadopenvswitch-a75777916820892493ae797e88dafd62317c00a7.tar.gz
in-band: Avoid "cast increases required alignment of target type" warning.
Casting a struct ofp_action_output object's address to type union ofp_action * provokes a warning on sparc. It's easier to just declare the object as having type union ofp_action, even though I don't think that there is a real problem here.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/in-band.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ofproto/in-band.c b/ofproto/in-band.c
index e04ae6092..710aadd9d 100644
--- a/ofproto/in-band.c
+++ b/ofproto/in-band.c
@@ -404,19 +404,18 @@ add_rule(struct in_band *ib, const struct cls_rule *rule)
{
struct {
struct nx_action_set_queue nxsq;
- struct ofp_action_output oao;
+ union ofp_action oa;
} actions;
memset(&actions, 0, sizeof actions);
- actions.oao.type = htons(OFPAT_OUTPUT);
- actions.oao.len = htons(sizeof actions.oao);
- actions.oao.port = htons(OFPP_NORMAL);
- actions.oao.max_len = htons(0);
+ actions.oa.output.type = htons(OFPAT_OUTPUT);
+ actions.oa.output.len = htons(sizeof actions.oa);
+ actions.oa.output.port = htons(OFPP_NORMAL);
+ actions.oa.output.max_len = htons(0);
if (ib->queue_id < 0) {
- ofproto_add_flow(ib->ofproto, rule,
- (union ofp_action *) &actions.oao, 1);
+ ofproto_add_flow(ib->ofproto, rule, &actions.oa, 1);
} else {
actions.nxsq.type = htons(OFPAT_VENDOR);
actions.nxsq.len = htons(sizeof actions.nxsq);