X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fmultipath.c;h=0a58c062c76821162cb15ed19c2fbb612b5613a4;hb=f76def2592cc5cb449a3360430ee9cc0f208765d;hp=8983c6a09a71ed63c28688e262b74a1c465fda58;hpb=c2d936a44fa612e88c743c6e7b367a9813093202;p=cascardo%2Fovs.git diff --git a/lib/multipath.c b/lib/multipath.c index 8983c6a09..0a58c062c 100644 --- a/lib/multipath.c +++ b/lib/multipath.c @@ -139,7 +139,7 @@ multipath_algorithm(uint32_t hash, enum nx_mp_algorithm algorithm, * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string.*/ -static char * WARN_UNUSED_RESULT +static char * OVS_WARN_UNUSED_RESULT multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s) { char *save_ptr = NULL; @@ -162,6 +162,10 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s) mp->fields = NX_HASH_FIELDS_ETH_SRC; } else if (!strcasecmp(fields, "symmetric_l4")) { mp->fields = NX_HASH_FIELDS_SYMMETRIC_L4; + } else if (!strcasecmp(fields, "symmetric_l3l4")) { + mp->fields = NX_HASH_FIELDS_SYMMETRIC_L3L4; + } else if (!strcasecmp(fields, "symmetric_l3l4+udp")) { + mp->fields = NX_HASH_FIELDS_SYMMETRIC_L3L4_UDP; } else { return xasprintf("%s: unknown fields `%s'", s_, fields); } @@ -189,6 +193,10 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s) if (error) { return error; } + if (!mf_nxm_header(mp->dst.field->id)) { + return xasprintf("%s: experimenter OXM field '%s' not supported", + s, dst); + } if (mp->dst.n_bits < 16 && n_links > (1u << mp->dst.n_bits)) { return xasprintf("%s: %d-bit destination field has %u possible " "values, less than specified n_links %d", @@ -203,7 +211,7 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s) * * Returns NULL if successful, otherwise a malloc()'d string describing the * error. The caller is responsible for freeing the returned string. */ -char * WARN_UNUSED_RESULT +char * OVS_WARN_UNUSED_RESULT multipath_parse(struct ofpact_multipath *mp, const char *s_) { char *s = xstrdup(s_);