]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Ensure consistent error messages from ifconfig(8).
authorhselasky <hselasky@FreeBSD.org>
Thu, 26 Nov 2020 16:36:50 +0000 (16:36 +0000)
committerhselasky <hselasky@FreeBSD.org>
Thu, 26 Nov 2020 16:36:50 +0000 (16:36 +0000)
commit1e1025dfb81fdf078c1ca9e8c1cc277bf8637191
tree8e7ff66b976cd4d96561d73bf296605d1a455a50
parent5afe096970b19e2d3bc3b44a1a09ae788e33795c
Ensure consistent error messages from ifconfig(8).

If multiple threads are invoking "ifconfig XXX create" a race may occur
which can lead to two different error messages for the same error.

a) ifconfig: SIOCIFCREATE2: File exists
b) ifconfig: interface XXX already exists

This patch ensures ifconfig prints the same error code
for the same case.

Reviewed by: imp@ and kib@
Differential Revision: https://reviews.freebsd.org/D27380
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
sbin/ifconfig/ifclone.c
sbin/ifconfig/ifconfig.c
sbin/ifconfig/ifconfig.h
sbin/ifconfig/ifieee80211.c
sbin/ifconfig/iflagg.c
sbin/ifconfig/ifvlan.c
sbin/ifconfig/ifvxlan.c