Sebastien Roy wrote:
> In the current clearview gate's usr/src/lib/libdladm/common/linkprop.c, 
> what is the difference between pd_getmod and pd_get in prop_desc_t.  The 
> comments state:
> 
>       /*
>        * callback to get modifiable link property
>        */
>       pd_getf_t       *pd_getmod;
> 
>       /*
>        * callback to get current link property
>        */
>       pd_getf_t       *pd_get;
> 
> What is "modifiable", and how do I know if my property is "modifiable"? 
> It doesn't mean "writable", since "autopush" and "zone" are both 
> "writable" and don't define pd_getmod.
> 
This is added back when wifi linkprop is supported, and at that time, it is 
called as "modifiable" linkprop. My understanding is that it actually means 
the "possible supported" values of a specific linkprop. If set_linkprop 
fails because the specified value is not supported, it will try to set to 
another "possible" value, which is returned from this pd_getmod() callback.

> Also, pd_check is confusing:
> 
>       /*
>        * callback to validate link property value; only be set if pd_optval
>        * is not NULL. In that case, validate the value by comparing it with
>        * the pd_optsval. Return a val_desc_t array pointer if the value is
>        * valid.
>        */
>       pd_checkf_t     *pd_check;
> 
> The comment seems to be out of touch with the implementation, since 
> pd_optval _is_ NULL for both the "autopush" and "zone" properties, yet 
> they both define a pd_check callback.  As a matter of fact, it looks like 
> the only properties that don't define pd_check are those that do define 
> pd_optval.  Did the comment mean to say "only be set if pd_optval is NULL"?
> 
I will change the comment to be:

" callback to validate link property value, set to NULL if pd_optval is not 
NULL. In that case, ...."

Thanks
- Cathy

Reply via email to