While doing some assorted cleanup in the UV gate, I noticed two minor
issues with the dladm_*_conf_field() APIs:
1. dladm_set_conf_field() has the following prototype:
dladm_status_t
dladm_set_conf_field(dladm_conf_t conf, const char *attr,
dladm_datatype_t type, void *attrval)
Note the final argument of `attrval'. As best I can tell, this
should be `const void *attrval' -- and because it's not, the
callers often have to cast away const, bloating the call sites.
2. dladm_get_conf_field() has the following prototype:
dladm_status_t
dladm_get_conf_field(dladm_conf_t conf, const char *attr,
dladm_datatype_t *type, void *attrval, size_t attrsz)
While this signature provides a certain symmetry with
dladm_set_conf_field(), every caller already knows the type
(otherwise, they wouldn't know how to fill in `attrsz'), and
thus passes NULL for the third argument. Again, this bloats
the call sites.
So, does anyone have any issue with constifying the last argument to
dladm_set_conf_field() and removing the third argument from
dladm_get_conf_field()?
--
meem