In the process of exploring Brussels/ndd/legacy support issues,
I ran into a puzzling piece of code in nd_getset():
                                                                              
    100                  /*                                                   
    101                   * (temporary) hack: "*valp" is size of user buffer ..
    102                   * copyout. If result of action routine is too big,  
     :                                                                        
    106                   * "*valp" bad or not given.                         
    107                   */                                                  
    108                  if (valp)                                            
    109                          (void) ddi_strtol(valp, NULL, 10, &avail);   
                                                                              
I can't see who is setting the length in the b_rptr. And why they            
would want to do this, when ioc_count is available? As Meem pointed out,

> It'd be ndd itself that would put that size in         
> there, right?  But I don't see evidence it's doing that, nor that it ever 
> did that.  So I'd guess that "valp" is always NULL and we don't go through
> that codepath.  

Moreover, looks like valp has to be null because of the immediately preceding
lines:

       94          while (*valp++)                                              
       95                  noop;                                                
       96          if (!*valp || valp >= (char *)mp1->b_wptr)                   
       97                  valp = NULL;                                         
 
Does anyone have any history about this code (which seems to have
been around for a very long time) and esp. the "backward
compatibility" reference in the comment? Is there some application
out there that sends the ND ioctl directly, and is relying on the "hack"
code? 

--Sowmini


Reply via email to