Source-Changes-HG archive

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

[src/trunk]: src/sys/net Avoid init'ing lo0 twice ... which rump kernels do w...



details:   https://anonhg.NetBSD.org/src/rev/88ecb6ffe2b3
branches:  trunk
changeset: 817189:88ecb6ffe2b3
user:      kre <kre%NetBSD.org@localhost>
date:      Thu Aug 11 13:57:02 2016 +0000

description:
Avoid init'ing lo0 twice ... which rump kernels do without this hack.
If rump gets fixed, this could be removed (though it is harmless in
any case.)

This should fix several more of the currently failing ATF tests.

diffstat:

 sys/net/if_loop.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 3a95e9c0d25b -r 88ecb6ffe2b3 sys/net/if_loop.c
--- a/sys/net/if_loop.c Thu Aug 11 09:48:57 2016 +0000
+++ b/sys/net/if_loop.c Thu Aug 11 13:57:02 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_loop.c,v 1.91 2016/08/10 10:09:42 kre Exp $ */
+/*     $NetBSD: if_loop.c,v 1.92 2016/08/11 13:57:02 kre Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.91 2016/08/10 10:09:42 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.92 2016/08/11 13:57:02 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -154,6 +154,9 @@
 loopinit(void)
 {
 
+       if (lo0ifp != NULL)     /* can happen in rump kernel */
+               return;
+
        (void)loop_clone_create(&loop_cloner, 0);       /* lo0 always exists */
        if_clone_attach(&loop_cloner);
 }



Home | Main Index | Thread Index | Old Index