git: 4c9650ac3162 - stable/13 - ifconfig: print interface name on SIOCIFCREATE2 error

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 21 Sep 2022 14:01:03 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=4c9650ac316214c7819fefdd20df766ea8c2b854

commit 4c9650ac316214c7819fefdd20df766ea8c2b854
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-09-06 13:09:39 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-09-21 11:39:13 +0000

    ifconfig: print interface name on SIOCIFCREATE2 error
    
    We have repeatedly gotten reports of unclassified SIOCIFCREATE2 errors
    (usually "Device not configured").  This can happen if there is
    configuration for interfaces in rc.conf which do not (yet) exist and
    we try to configure.  I can, e.g., provoke this by configuring wlan
    interfaces with their physical interface not installed.
    In order to cut support (guesswork) down print the name of the
    interface to be configured with the error message.
    Hopefully this will help us in the future to improve other configuration
    or driver problems.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit ac606903a800bc4ce80bc6fa1374b45efcdb7014)
---
 sbin/ifconfig/ifconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 9e7d38d4c2a4..f01f40e46a8b 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -207,7 +207,7 @@ ioctl_ifcreate(int s, struct ifreq *ifr)
 		case EEXIST:
 			errx(1, "interface %s already exists", ifr->ifr_name);
 		default:
-			err(1, "SIOCIFCREATE2");
+			err(1, "SIOCIFCREATE2 (%s)", ifr->ifr_name);
 		}
 	}
 }