Take a look at the dev_ifsioc() function in ioctl32.c-- it does not
copy the data back to userspace except for SIOCSIFMAP, and judging
from the strict definition of TUNSETIFF it should not be required to
do so.
IMHO this isn't true -

   switch (cmd) {
    case SIOCGIFFLAGS:
    case SIOCGIFMETRIC:
    case SIOCGIFMTU:
    case SIOCGIFMEM:
    case SIOCGIFHWADDR:
    case SIOCGIFINDEX:
    case SIOCGIFADDR:
    case SIOCGIFBRDADDR:
    case SIOCGIFDSTADDR:
    case SIOCGIFNETMASK:
    case SIOCGIFTXQLEN:
      if (copy_to_user(uifr32, &ifr, sizeof(*uifr32)))
        return -EFAULT;
      break;
    case SIOCGIFMAP:

- the (modified) struct is copied in all cases listed above. But what do you mean by "the strict definition of TUNSETIFF"?



I think if this is functionality that is required (I see no TUNGETIFF, but I don't play with this stuff enough to know) the directionality of the ioctl definition should be _IOWR rather than _IOR; in any case, the "argument" field should not be "int" but rather "struct ifreq*" in if_tun.h. Likely, neither will change for historical reasons....


The idea behind all that is, that the application needs (?) to know the name of the device (tunX) to do further ioctls on that device! Of course, it could be hardcoded, but that doesn't seem as nice ...


Why should be be _IOWR there?

Thanks,
Michael
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to