]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ifconfig(8): Don't set network interface capabilities when there is no change.
authorHans Petter Selasky <hselasky@FreeBSD.org>
Tue, 9 Nov 2021 21:07:43 +0000 (22:07 +0100)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Wed, 10 Nov 2021 14:50:52 +0000 (15:50 +0100)
commitad8f078f66e51212cdccd91fe8b22fb81235018e
tree4f54f9244838bdfe84e0485f53b3f0db36c1dd9d
parent81b22a9892b1047e551fc3f1d6d58031bc59a4c3
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)
MFC after: 1 week
Sponsored by: NVIDIA Networking
sbin/ifconfig/ifconfig.c