X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-errors.c;h=d1e4dbf98edd91561b9fde512dfeb2de0cb9338c;hb=79bda8258b5365438a70d08c74fab903f1dc0a29;hp=52856458cbd1fafb3da04c651812774313e40541;hpb=514887ee4666894c4d0b93960ce3d33515611fa9;p=sliver-openvswitch.git diff --git a/lib/ofp-errors.c b/lib/ofp-errors.c index 52856458c..d1e4dbf98 100644 --- a/lib/ofp-errors.c +++ b/lib/ofp-errors.c @@ -50,6 +50,8 @@ ofperr_domain_from_version(enum ofp_version version) return &ofperr_of12; case OFP13_VERSION: return &ofperr_of13; + case OFP14_VERSION: + return &ofperr_of14; default: return NULL; } @@ -154,7 +156,7 @@ ofperr_encode_msg__(enum ofperr error, enum ofp_version ofp_version, if (!ofperr_is_valid(error)) { /* 'error' seems likely to be a system errno value. */ VLOG_ERR_RL(&rl, "invalid OpenFlow error code %d (%s)", - error, strerror(error)); + error, ovs_strerror(error)); error = OFPERR_NXBRC_UNENCODABLE_ERROR; } else if (domain->errors[error - OFPERR_OFS].code < 0) { VLOG_ERR_RL(&rl, "cannot encode %s for %s", @@ -321,17 +323,19 @@ ofperr_decode_msg(const struct ofp_header *oh, struct ofpbuf *payload) /* Translate the error type and code into an ofperr. */ error = ofperr_decode(oh->version, vendor, type, code); if (error && payload) { - ofpbuf_use_const(payload, b.data, b.size); + ofpbuf_use_const(payload, ofpbuf_data(&b), ofpbuf_size(&b)); } return error; } /* If 'error' is a valid OFPERR_* value, returns its name * (e.g. "OFPBRC_BAD_TYPE" for OFPBRC_BAD_TYPE). Otherwise, assumes that - * 'error' is a positive errno value and returns what strerror() produces for - * 'error'. */ + * 'error' is a positive errno value and returns what ovs_strerror() produces + * for 'error'. */ const char * ofperr_to_string(enum ofperr error) { - return ofperr_is_valid(error) ? ofperr_get_name(error) : strerror(error); + return (ofperr_is_valid(error) + ? ofperr_get_name(error) + : ovs_strerror(error)); }