HomeFreeBSD

if_media.c SIOCGMEDIAX handler: improve loop

Description

if_media.c SIOCGMEDIAX handler: improve loop

Stop advancing counter past the current iteration number at the start
of iteration. This removes the need of subtracting one when
calculating index for copyout, and arguably fixes off-by-one reporting
of copied out elements when copyout failed.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies / NVidia Networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D27073

Details

Provenance
kibAuthored on
Reviewer
hselasky
Differential Revision
D27073: if_media.c SIOCGMEDIAX handler: improve loop
Parents
rS367295: Document how to set ports options via make.conf(5)
Branches
Unknown
Tags
Unknown