Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Clear ifm_cur and ifm_media after removing all ifmed...



details:   https://anonhg.NetBSD.org/src/rev/ddbff8375a1a
branches:  trunk
changeset: 356995:ddbff8375a1a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Oct 23 03:54:40 2017 +0000

description:
Clear ifm_cur and ifm_media after removing all ifmedia entries(IFM_INST_ANY)
in ifmedia_delete_instance() like if_media.c rev. 1.32.
Now if_media_delete_instance(IFM_INST_ANY) is the same as ifmedia_removeall().

diffstat:

 sys/net/if_media.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r ea7afe512ec8 -r ddbff8375a1a sys/net/if_media.c
--- a/sys/net/if_media.c        Mon Oct 23 02:38:46 2017 +0000
+++ b/sys/net/if_media.c        Mon Oct 23 03:54:40 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_media.c,v 1.33 2017/10/20 08:04:39 msaitoh Exp $    */
+/*     $NetBSD: if_media.c,v 1.34 2017/10/23 03:54:40 msaitoh Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.33 2017/10/20 08:04:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.34 2017/10/23 03:54:40 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -405,6 +405,10 @@
                        free(ife, M_IFMEDIA);
                }
        }
+       if (inst == IFM_INST_ANY) {
+               ifm->ifm_cur = NULL;
+               ifm->ifm_media = IFM_NONE;
+       }
 }
 
 void
@@ -412,8 +416,6 @@
 {
 
        ifmedia_delete_instance(ifm, IFM_INST_ANY);
-       ifm->ifm_cur = NULL;
-       ifm->ifm_media = IFM_NONE;
 }
 
 



Home | Main Index | Thread Index | Old Index