mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
Merge "master" into "ovn".
This allows OVN to take advantage of the client scalability changes that have been committed to ovsdb-server on master recently. Conflicts: Makefile.am lib/learn.c
This commit is contained in:
24
lib/learn.c
24
lib/learn.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc.
|
||||
* Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -189,28 +189,14 @@ static char * OVS_WARN_UNUSED_RESULT
|
||||
learn_parse_load_immediate(const char *s, struct ofpact_learn_spec *spec)
|
||||
{
|
||||
const char *full_s = s;
|
||||
const char *arrow = strstr(s, "->");
|
||||
struct mf_subfield dst;
|
||||
union mf_subvalue imm;
|
||||
char *error;
|
||||
int err;
|
||||
|
||||
memset(&imm, 0, sizeof imm);
|
||||
if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X') && arrow) {
|
||||
const char *in = arrow - 1;
|
||||
uint8_t *out = imm.u8 + sizeof imm.u8 - 1;
|
||||
int n = arrow - (s + 2);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
int hexit = hexit_value(in[-i]);
|
||||
if (hexit < 0) {
|
||||
return xasprintf("%s: bad hex digit in value", full_s);
|
||||
}
|
||||
out[-(i / 2)] |= i % 2 ? hexit << 4 : hexit;
|
||||
}
|
||||
s = arrow;
|
||||
} else {
|
||||
imm.integer = htonll(strtoull(s, (char **) &s, 0));
|
||||
err = parse_int_string(s, imm.u8, sizeof imm.u8, (char **) &s);
|
||||
if (err) {
|
||||
return xasprintf("%s: too many bits in immediate value", full_s);
|
||||
}
|
||||
|
||||
if (strncmp(s, "->", 2)) {
|
||||
|
Reference in New Issue
Block a user