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
dhcp: Make dhcp_option_to_string() act sensibly with null or empty options.
[sliver-openvswitch.git]
/
lib
/
dhcp.c
diff --git
a/lib/dhcp.c
b/lib/dhcp.c
index
3c0ed82
..
0d3cf5f
100644
(file)
--- a/
lib/dhcp.c
+++ b/
lib/dhcp.c
@@
-419,6
+419,11
@@
dhcp_option_to_string(const struct dhcp_option *opt, int code, struct ds *ds)
}
ds_put_char(ds, '=');
+ if (!opt->data || !opt->n) {
+ ds_put_cstr(ds, opt->data ? "empty" : "null");
+ return ds_cstr(ds);
+ }
+
if (class->type == DHCP_ARG_STRING) {
ds_put_char(ds, '"');
}