HomeFreeBSD

ifconfig(8): Don't set network interface capabilities when there is no change.

Description

ifconfig(8): Don't set network interface capabilities when there is no change.

A quick grep through the kernel code shows network drivers compute the
changed bits of network capabilities after a SIOCSIFCAP IOCTL(2) by
using the bitwise exclusive or operation. When the set capabilities
are equal to the already read capabilities, no action will be taken.

Let ifconfig(8) predict this case and skip the SIOCSIFCAP IOCTL(2)
system call.

Discussed with: kib@ (revert change in case of issues)
Sponsored by: NVIDIA Networking

(cherry picked from commit ad8f078f66e51212cdccd91fe8b22fb81235018e)

Details

Provenance
hselaskyAuthored on Nov 9 2021, 9:07 PM
Parents
rGa889d262a758: Remove dead code.
Branches
Unknown
Tags
Unknown