[Bug 273458] SIOCGIFDATA should be _IORW not _IOW

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 30 Aug 2023 19:23:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273458

            Bug ID: 273458
           Summary: SIOCGIFDATA should be _IORW not _IOW
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: nreilly@blackberry.com

sys/sys/sockio.h line 85:

#define SIOCGIFDATA      _IOW('i', 44, struct ifreq)    /* get if_data */

This is a get function so it should be _IORW and not _IOW.

There was a comment on https://reviews.freebsd.org/D26538:
"Can't it be plain _IOW? This ioctl does not modify the request structure."

but that is not correct. While it doesn't touch the ifreq structure, it does
modify the values in the if_data structure that is pointed to by the ifr_data
member of the ifreq.

This doesn't seem to have an adverse affect on FreeBSD 13.2, the data is still
correctly returned.

-- 
You are receiving this mail because:
You are the assignee for the bug.