git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better dependencies for external links
[sliver-openvswitch.git]
/
lib
/
bundle.c
diff --git
a/lib/bundle.c
b/lib/bundle.c
index
e0f8e6b
..
92ac1e1
100644
(file)
--- a/
lib/bundle.c
+++ b/
lib/bundle.c
@@
-267,12
+267,14
@@
bundle_parse__(const char *s, char **save_ptr,
uint16_t slave_port;
char *slave;
uint16_t slave_port;
char *slave;
- slave = strtok_r(NULL, ", [", save_ptr);
+ slave = strtok_r(NULL, ", [
]
", save_ptr);
if (!slave || bundle->n_slaves >= BUNDLE_MAX_SLAVES) {
break;
}
if (!slave || bundle->n_slaves >= BUNDLE_MAX_SLAVES) {
break;
}
- slave_port = atoi(slave);
+ if (!ofputil_port_from_string(slave, &slave_port)) {
+ ovs_fatal(0, "%s: bad port number", slave);
+ }
ofpbuf_put(ofpacts, &slave_port, sizeof slave_port);
bundle = ofpacts->l2;
ofpbuf_put(ofpacts, &slave_port, sizeof slave_port);
bundle = ofpacts->l2;
@@
-387,7
+389,7
@@
bundle_format(const struct ofpact_bundle *bundle, struct ds *s)
ds_put_cstr(s, ",");
}
ds_put_cstr(s, ",");
}
-
ds_put_format(s, "%"PRIu16, bundle->slaves[i]
);
+
ofputil_format_port(bundle->slaves[i], s
);
}
ds_put_cstr(s, ")");
}
ds_put_cstr(s, ")");