X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=2fb2fc87bbf949bfb9cd7c22baabed6bf6f2328d;hb=4cceacb94cfc1d75a961d3d746d2ae369c397ae5;hp=a128a6d9c8724d5beb0b3d9856ab8eb4f41ef58d;hpb=64626975103668a5662622819536780ba87bef79;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index a128a6d9..2fb2fc87 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -379,7 +379,7 @@ ofproto_create(const char *datapath_name, const char *datapath_type, hash_string(ofproto->name, 0)); ofproto->datapath_id = 0; ofproto_set_flow_eviction_threshold(ofproto, - OFPROTO_FLOW_EVICTON_THRESHOLD_DEFAULT); + OFPROTO_FLOW_EVICTION_THRESHOLD_DEFAULT); ofproto->forward_bpdu = false; ofproto->fallback_dpid = pick_fallback_dpid(); ofproto->mfr_desc = xstrdup(DEFAULT_MFR_DESC); @@ -2988,7 +2988,7 @@ add_flow(struct ofproto *ofproto, struct ofconn *ofconn, rule->evictable = was_evictable; if (!evict) { - error = OFPERR_OFPFMFC_ALL_TABLES_FULL; + error = OFPERR_OFPFMFC_TABLE_FULL; goto exit; } else if (evict->pending) { error = OFPROTO_POSTPONE; @@ -3080,6 +3080,17 @@ modify_flows__(struct ofproto *ofproto, struct ofconn *ofconn, return error; } +static enum ofperr +modify_flows_add(struct ofproto *ofproto, struct ofconn *ofconn, + const struct ofputil_flow_mod *fm, + const struct ofp_header *request) +{ + if (fm->cookie_mask != htonll(0) || fm->new_cookie == htonll(UINT64_MAX)) { + return 0; + } + return add_flow(ofproto, ofconn, fm, request); +} + /* Implements OFPFC_MODIFY. Returns 0 on success or an OpenFlow error code on * failure. * @@ -3099,7 +3110,7 @@ modify_flows_loose(struct ofproto *ofproto, struct ofconn *ofconn, if (error) { return error; } else if (list_is_empty(&rules)) { - return fm->cookie_mask ? 0 : add_flow(ofproto, ofconn, fm, request); + return modify_flows_add(ofproto, ofconn, fm, request); } else { return modify_flows__(ofproto, ofconn, fm, request, &rules); } @@ -3125,7 +3136,7 @@ modify_flow_strict(struct ofproto *ofproto, struct ofconn *ofconn, if (error) { return error; } else if (list_is_empty(&rules)) { - return fm->cookie_mask ? 0 : add_flow(ofproto, ofconn, fm, request); + return modify_flows_add(ofproto, ofconn, fm, request); } else { return list_is_singleton(&rules) ? modify_flows__(ofproto, ofconn, fm, request, &rules) @@ -3293,7 +3304,7 @@ handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh) * is not required in OpenFlow 1.0.1 and removed from OpenFlow 1.1. * There is no good error code, so just state that the flow table * is full. */ - error = OFPERR_OFPFMFC_ALL_TABLES_FULL; + error = OFPERR_OFPFMFC_TABLE_FULL; } if (!error) { error = ofpacts_check(fm.ofpacts, fm.ofpacts_len,