On 26 May 2015 at 18:03, Ben Pfaff <[email protected]> wrote:
> On Thu, May 21, 2015 at 03:11:50PM -0700, Joe Stringer wrote:
>> Signed-off-by: Joe Stringer <[email protected]>
>
> ...
>> + s += strspn(s, "0123456789abcdef");
>
> It would be kind to skip capital hex digits too, just in case someone
> manually retypes one with caps lock on.
>
> Acked-by: Ben Pfaff <[email protected]>
Thanks for the review, I applied the following incremental and applied
the patch to master:
diff --git a/lib/odp-util.c b/lib/odp-util.c
index c176f84..e6c1070 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -51,6 +51,8 @@ VLOG_DEFINE_THIS_MODULE(odp_util);
* from another. */
static const char *delimiters = ", \t\r\n";
+static const char *hex_chars = "0123456789abcdefABCDEF";
+
static int parse_odp_key_mask_attr(const char *, const struct simap
*port_names,
struct ofpbuf *, struct ofpbuf *);
static void format_odp_key_attr(const struct nlattr *a,
@@ -2078,7 +2080,7 @@ odp_ufid_from_string(const char *s_, ovs_u128 *ufid)
s += 2;
}
- n = strspn(s, "0123456789abcdefABCDEF");
+ n = strspn(s, hex_chars);
if (n != 32) {
return -EINVAL;
}
@@ -2719,7 +2721,7 @@ parse_odp_key_mask_attr(const char *s, const
struct simap *port_names,
/* Skip UFID. */
s += 5;
- s += strspn(s, "0123456789abcdef");
+ s += strspn(s, hex_chars);
s += strspn(s, delimiters);
return s - start;
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev