Module Name:    src
Committed By:   roy
Date:           Mon Oct  5 17:29:22 UTC 2020

Modified Files:
        src/sbin/ifconfig: media.c

Log Message:
Minor correction to prior


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sbin/ifconfig/media.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ifconfig/media.c
diff -u src/sbin/ifconfig/media.c:1.11 src/sbin/ifconfig/media.c:1.12
--- src/sbin/ifconfig/media.c:1.11	Mon Oct  5 16:17:05 2020
+++ src/sbin/ifconfig/media.c	Mon Oct  5 17:29:22 2020
@@ -1,6 +1,6 @@
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: media.c,v 1.11 2020/10/05 16:17:05 roy Exp $");
+__RCSID("$NetBSD: media.c,v 1.12 2020/10/05 17:29:22 roy Exp $");
 #endif /* not lint */
 
 #include <assert.h>
@@ -424,10 +424,10 @@ media_status(int media_type, int link_st
 		return;
 	}
 
-	/* Interface link status is queried through SIOCGIFMEDIA.
-	 * Not all interfaces have actual media. */
-	if (ifmr.ifm_count == 0)
+	if (ifmr.ifm_count == 0) {
 		warnx("%s: no media types?", ifname);
+		return;
+	}
 
 	media_list = calloc(ifmr.ifm_count, sizeof(int));
 	if (media_list == NULL)

Reply via email to