]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
add SIOCGIFDATA ioctl
authoremaste <emaste@FreeBSD.org>
Mon, 28 Sep 2020 16:54:39 +0000 (16:54 +0000)
committeremaste <emaste@FreeBSD.org>
Mon, 28 Sep 2020 16:54:39 +0000 (16:54 +0000)
commit61213163ca1e94cc1dcf7427250aec078b62fa8f
tree89180bf4e34a12c87daa0f08f2821aac6c21bef1
parent49f341315a58706bdaaf99370d1f4f9e40569126
add SIOCGIFDATA ioctl

For interfaces that do not support SIOCGIFMEDIA (for which there are
quite a few) the only fallback is to query the interface for
if_data->ifi_link_state.  While it's possible to get at if_data for an
interface via getifaddrs(3) or sysctl, both are heavy weight mechanisms.

SIOCGIFDATA is a simple ioctl to retrieve this fast with very little
resource use in comparison.  This implementation mirrors that of other
similar ioctls in FreeBSD.

Submitted by: Roy Marples <roy@marples.name>
Reviewed by: markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D26538
share/man/man9/ifnet.9
sys/net/if.c
sys/sys/sockio.h