Module Name: src Committed By: christos Date: Sat Aug 13 11:19:35 UTC 2016
Modified Files: src/sys/rump/net/lib/libnetinet: netinet_component.c src/sys/rump/net/lib/libnetinet6: netinet6_component.c Log Message: Don't call loopinit() here. Instead panic if -lrumpnet_net has not been called to initialize lo0ifp. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libnetinet/netinet_component.c cvs rdiff -u -r1.5 -r1.6 \ src/sys/rump/net/lib/libnetinet6/netinet6_component.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/net/lib/libnetinet/netinet_component.c diff -u src/sys/rump/net/lib/libnetinet/netinet_component.c:1.6 src/sys/rump/net/lib/libnetinet/netinet_component.c:1.7 --- src/sys/rump/net/lib/libnetinet/netinet_component.c:1.6 Fri Aug 12 07:43:04 2016 +++ src/sys/rump/net/lib/libnetinet/netinet_component.c Sat Aug 13 07:19:35 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: netinet_component.c,v 1.6 2016/08/12 11:43:04 christos Exp $ */ +/* $NetBSD: netinet_component.c,v 1.7 2016/08/13 11:19:35 christos Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.6 2016/08/12 11:43:04 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.7 2016/08/13 11:19:35 christos Exp $"); #include <sys/param.h> #include <sys/domain.h> @@ -54,7 +54,6 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET) domain_attach(&arpdomain); domain_attach(&inetdomain); - loopinit(); carpattach(1); rump_netisr_register(NETISR_ARP, arpintr); @@ -67,6 +66,9 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG) struct socket *so; int error; + if (lo0ifp == NULL) + panic("lo0 config: rumpnet_net has not been initialized"); + if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, curlwp, NULL)) != 0) panic("lo0 config: cannot create socket"); Index: src/sys/rump/net/lib/libnetinet6/netinet6_component.c diff -u src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.5 src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.6 --- src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.5 Fri Aug 12 07:43:04 2016 +++ src/sys/rump/net/lib/libnetinet6/netinet6_component.c Sat Aug 13 07:19:35 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: netinet6_component.c,v 1.5 2016/08/12 11:43:04 christos Exp $ */ +/* $NetBSD: netinet6_component.c,v 1.6 2016/08/13 11:19:35 christos Exp $ */ /* * Copyright (c) 2013 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.5 2016/08/12 11:43:04 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.6 2016/08/13 11:19:35 christos Exp $"); #include <sys/param.h> #include <sys/domain.h> @@ -48,12 +48,12 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET) extern struct domain inet6domain; domain_attach(&inet6domain); - - loopinit(); } RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG) { + if (lo0ifp == NULL) + panic("lo0 config: rumpnet_net has not been initialized"); if_up(lo0ifp); }