ifconfig: fail with a warning if called on a non-existent interface.
This commit is contained in:
@@ -509,6 +509,11 @@ list_interface(const char* name)
|
|||||||
// get link level interface for this interface
|
// get link level interface for this interface
|
||||||
|
|
||||||
BNetworkInterface interface(name);
|
BNetworkInterface interface(name);
|
||||||
|
if (!interface.Exists()) {
|
||||||
|
printf("Interface not found!\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BNetworkAddress linkAddress;
|
BNetworkAddress linkAddress;
|
||||||
status_t status = interface.GetHardwareAddress(linkAddress);
|
status_t status = interface.GetHardwareAddress(linkAddress);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user