static bool ofproto_group_exists(const struct ofproto *ofproto,
uint32_t group_id)
OVS_EXCLUDED(ofproto->groups_rwlock);
-static enum ofperr add_group(struct ofproto *, struct ofputil_group_mod *);
+static enum ofperr add_group(struct ofproto *,
+ const struct ofputil_group_mod *);
static void handle_openflow(struct ofconn *, const struct ofpbuf *);
static enum ofperr ofproto_flow_mod_start(struct ofproto *,
struct ofproto_flow_mod *)
}
static enum ofperr
-init_group(struct ofproto *ofproto, struct ofputil_group_mod *gm,
+init_group(struct ofproto *ofproto, const struct ofputil_group_mod *gm,
struct ofgroup **ofgroup)
{
enum ofperr error;
*CONST_CAST(long long int *, &((*ofgroup)->modified)) = now;
ovs_refcount_init(&(*ofgroup)->ref_count);
- list_move(&(*ofgroup)->buckets, &gm->buckets);
+ list_init(&(*ofgroup)->buckets);
+ ofputil_bucket_clone_list(&(*ofgroup)->buckets, &gm->buckets, NULL);
+
*CONST_CAST(uint32_t *, &(*ofgroup)->n_buckets) =
list_size(&(*ofgroup)->buckets);
* 'ofproto''s group table. Returns 0 on success or an OpenFlow error code on
* failure. */
static enum ofperr
-add_group(struct ofproto *ofproto, struct ofputil_group_mod *gm)
+add_group(struct ofproto *ofproto, const struct ofputil_group_mod *gm)
{
struct ofgroup *ofgroup;
enum ofperr error;
* ofproto's ofgroup hash map. Thus, the group is never altered while users of
* the xlate module hold a pointer to the group. */
static enum ofperr
-modify_group(struct ofproto *ofproto, struct ofputil_group_mod *gm)
+modify_group(struct ofproto *ofproto, const struct ofputil_group_mod *gm)
{
struct ofgroup *ofgroup, *new_ofgroup, *retiring;
enum ofperr error;
VLOG_INFO_RL(&rl, "%s: Invalid group_mod command type %d",
ofproto->name, gm.command);
}
- return OFPERR_OFPGMFC_BAD_COMMAND;
+ error = OFPERR_OFPGMFC_BAD_COMMAND;
}
if (!error) {
rf.group_mod = &gm;
connmgr_send_requestforward(ofproto->connmgr, ofconn, &rf);
}
+ ofputil_bucket_list_destroy(&gm.buckets);
+
return error;
}
shift
# OFPGC_ADD
- ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020000000000000001
+ ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
if test X"$1" = X"OFPGC_ADD"; then shift;
echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
- ADD group_id=1,type=all"
+ ADD group_id=1,type=all,bucket=actions=drop"
echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
- ADD group_id=1,type=all"
+ ADD group_id=1,type=all,bucket=bucket_id:0,actions=drop"
echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
- ADD group_id=1,type=all"
+ ADD group_id=1,type=all,bucket=actions=drop"
fi
# OFPGC_MODIFY
- ovs-appctl -t `pwd`/c2 ofctl/send 050f0010000000020001010000000001
+ ovs-appctl -t `pwd`/c2 ofctl/send "050f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
if test X"$1" = X"OFPGC_MODIFY"; then shift;
echo >>expout2 "send: OFPT_GROUP_MOD (OF1.4):
- MOD group_id=1,type=select"
+ MOD group_id=1,type=select,bucket=weight:0,actions=drop"
echo >>expout1 "OFPT_REQUESTFORWARD (OF1.5): reason=group_mod
- MOD group_id=1,type=select"
+ MOD group_id=1,type=select,bucket=bucket_id:0,weight:0,actions=drop"
echo >>expout3 "OFPT_REQUESTFORWARD (OF1.4): reason=group_mod
- MOD group_id=1,type=select"
+ MOD group_id=1,type=select,bucket=weight:0,actions=drop"
fi
ovs-appctl -t `pwd`/c1 ofctl/barrier