git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
150a9f1
)
bundle: Treat slave_type properly as 32-bit value.
author
Ben Pfaff
<blp@nicira.com>
Wed, 20 Jul 2011 16:50:37 +0000
(09:50 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Wed, 20 Jul 2011 16:59:08 +0000
(09:59 -0700)
Found by sparse.
lib/bundle.c
patch
|
blob
|
history
diff --git
a/lib/bundle.c
b/lib/bundle.c
index
0b0e361
..
996955f
100644
(file)
--- a/
lib/bundle.c
+++ b/
lib/bundle.c
@@
-69,7
+69,8
@@
int
bundle_check(const struct nx_action_bundle *nab, int max_ports)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
bundle_check(const struct nx_action_bundle *nab, int max_ports)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
- uint16_t n_slaves, fields, algorithm, slave_type, subtype;
+ uint16_t n_slaves, fields, algorithm, subtype;
+ uint32_t slave_type;
size_t slaves_size, i;
int error;
size_t slaves_size, i;
int error;
@@
-77,7
+78,7
@@
bundle_check(const struct nx_action_bundle *nab, int max_ports)
n_slaves = ntohs(nab->n_slaves);
fields = ntohs(nab->fields);
algorithm = ntohs(nab->algorithm);
n_slaves = ntohs(nab->n_slaves);
fields = ntohs(nab->fields);
algorithm = ntohs(nab->algorithm);
- slave_type = ntoh
s
(nab->slave_type);
+ slave_type = ntoh
l
(nab->slave_type);
slaves_size = ntohs(nab->len) - sizeof *nab;
error = ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT);
slaves_size = ntohs(nab->len) - sizeof *nab;
error = ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT);
@@
-204,7
+205,7
@@
bundle_parse(struct ofpbuf *b, const char *s)
}
if (!strcasecmp(slave_type, "ofport")) {
}
if (!strcasecmp(slave_type, "ofport")) {
- nab->slave_type = hton
s
(NXM_OF_IN_PORT);
+ nab->slave_type = hton
l
(NXM_OF_IN_PORT);
} else {
ovs_fatal(0, "%s: unknown slave_type `%s'", s, slave_type);
}
} else {
ovs_fatal(0, "%s: unknown slave_type `%s'", s, slave_type);
}
@@
-233,7
+234,7
@@
bundle_format(const struct nx_action_bundle *nab, struct ds *s)
algorithm = "<unknown>";
}
algorithm = "<unknown>";
}
- switch (ntoh
s
(nab->slave_type)) {
+ switch (ntoh
l
(nab->slave_type)) {
case NXM_OF_IN_PORT:
slave_type = "ofport";
break;
case NXM_OF_IN_PORT:
slave_type = "ofport";
break;