]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ifconfig: properly detect invalid mediaopt keywords.
authorKonstantin Belousov <kib@FreeBSD.org>
Mon, 2 Nov 2020 21:47:34 +0000 (21:47 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 2 Nov 2020 21:47:34 +0000 (21:47 +0000)
commit3f113d56061ab4c877d837b0d683414d1303131a
tree6fb079a0b95a4feaa7a8f42b2d84e27832554517
parentea07005137182d6fea2d5cc6967ddaa4a5bdbd5d
ifconfig: properly detect invalid mediaopt keywords.

When invalid keyword is specified, ifconfig(8) is silent about it,
instead random request is sent to the driver.

Before the patch:
root@r-freeb43:~ # ifconfig mce0 mediaopt -txpause,-rxpause
ifconfig: SIOCSIFMEDIA (media): Device not configured

After:
root@r-freeb43:~ # ifconfig mce0 mediaopt -txpause,-rxpause
ifconfig: unknown option: -txpause

Reviewed by: hselasky, kp
Sponsored by: Mellanox Technologies / NVidia Networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D27060
sbin/ifconfig/ifmedia.c