Date: Tue, 5 Dec 2006 15:03:41 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 111145 for review Message-ID: <200612051503.kB5F3fFe089229@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111145 Change 111145 by zec@zec_tca51 on 2006/12/05 15:03:17 If a function has an argument that holds a pointer to a vnet instance, set the local vnet * using this info, instead of using the per-thread vnet affinity (curvnetb). Furthermore, the macro which sets the local vnet * will compare the target vnet with the per-thread curvnetb, and panic if those two do not match. This should allow us to catch more inconsistencies than solely relying on curvnetb to be pointing to the correct vnet instance all the time. Affected files ... .. //depot/projects/vimage/src/sys/kern/kern_vimage.c#5 edit .. //depot/projects/vimage/src/sys/net/if.c#5 edit .. //depot/projects/vimage/src/sys/net/if_loop.c#3 edit .. //depot/projects/vimage/src/sys/net/if_stf.c#3 edit .. //depot/projects/vimage/src/sys/net/rtsock.c#4 edit .. //depot/projects/vimage/src/sys/netgraph/ng_ether.c#3 edit .. //depot/projects/vimage/src/sys/netinet/if_ether.c#4 edit .. //depot/projects/vimage/src/sys/netinet/igmp.c#3 edit .. //depot/projects/vimage/src/sys/netinet/in.c#3 edit .. //depot/projects/vimage/src/sys/netinet/in_pcb.c#3 edit .. //depot/projects/vimage/src/sys/netinet/ip_input.c#3 edit .. //depot/projects/vimage/src/sys/netinet/raw_ip.c#3 edit .. //depot/projects/vimage/src/sys/netinet/tcp_output.c#3 edit .. //depot/projects/vimage/src/sys/netinet/tcp_usrreq.c#3 edit .. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#3 edit .. //depot/projects/vimage/src/sys/netinet6/in6_ifattach.c#3 edit .. //depot/projects/vimage/src/sys/netinet6/in6_pcb.c#3 edit .. //depot/projects/vimage/src/sys/netinet6/nd6.c#4 edit .. //depot/projects/vimage/src/sys/netinet6/raw_ip6.c#3 edit .. //depot/projects/vimage/src/sys/netinet6/scope6.c#3 edit .. //depot/projects/vimage/src/sys/netinet6/udp6_usrreq.c#3 edit .. //depot/projects/vimage/src/sys/sys/vimage.h#4 edit Differences ... ==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#5 (text+ko) ==== ==== //depot/projects/vimage/src/sys/net/if.c#5 (text+ko) ==== @@ -408,6 +408,8 @@ #endif if_slowtimo(0); #ifdef VIMAGE + } else { + panic("if_check() called for a non-default vimage!?!"); } #endif } ==== //depot/projects/vimage/src/sys/net/if_loop.c#3 (text+ko) ==== @@ -124,7 +124,7 @@ lo_clone_destroy(ifp) struct ifnet *ifp; { - INIT_VNET_NET(curvnetb); + INIT_VNET_NET(ifp->if_vnetb); struct lo_softc *sc; sc = ifp->if_softc; @@ -291,7 +291,7 @@ int af; int hlen; { - INIT_VNET_NET(curvnetb); + INIT_VNET_NET(ifp->if_vnetb); int isr; M_ASSERTPKTHDR(m); ==== //depot/projects/vimage/src/sys/net/if_stf.c#3 (text+ko) ==== @@ -365,7 +365,7 @@ stf_getsrcifa6(ifp) struct ifnet *ifp; { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(ifp->if_vnetb); struct ifaddr *ia; struct in_ifaddr *ia4; struct sockaddr_in6 *sin6; ==== //depot/projects/vimage/src/sys/net/rtsock.c#4 (text+ko) ==== @@ -317,7 +317,7 @@ route_output(struct mbuf *m, struct socket *so) { #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) - INIT_VNET_NET(curvnetb); + INIT_VNET_NET(so->so_vnetb); struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; struct radix_node_head *rnh; ==== //depot/projects/vimage/src/sys/netgraph/ng_ether.c#3 (text+ko) ==== @@ -741,22 +741,14 @@ /* Create nodes for any already-existing Ethernet interfaces */ IFNET_RLOCK(); -#ifdef VIMAGE - struct vnet_base *vnetb_iter; - /* XXX LOCKING */ - LIST_FOREACH(vnetb_iter, &vnetb_head, vnetb_le) { - CURVNETB_SET(vnetb_iter); - INIT_VNET_NET(vnetb_iter); -#endif + VNETB_ITERLOOP_BEGIN(); + INIT_VNET_NET(vnetb_iter); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) ng_ether_attach(ifp); } -#ifdef VIMAGE - CURVNETB_RESTORE(); - } -#endif + VNETB_ITERLOOP_END(); IFNET_RUNLOCK(); break; ==== //depot/projects/vimage/src/sys/netinet/if_ether.c#4 (text+ko) ==== @@ -603,7 +603,6 @@ in_arpinput(m) struct mbuf *m; { - INIT_VNET_INET(curvnetb); struct arphdr *ah; struct ifnet *ifp = m->m_pkthdr.rcvif; struct llinfo_arp *la; @@ -621,6 +620,7 @@ #ifdef DEV_CARP int carp_match = 0; #endif + INIT_VNET_INET(ifp->if_vnetb); if (ifp->if_bridge) bridged = 1; @@ -995,7 +995,8 @@ static void arp_init(void) { - INIT_VNET_INET(curvnetb); /* XXX */ + INIT_VNET_INET(curvnetb); /* XXX should panic here! */ +printf("arp_init\n"); arpintrq.ifq_maxlen = 50; mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF); ==== //depot/projects/vimage/src/sys/netinet/igmp.c#3 (text+ko) ==== @@ -156,7 +156,7 @@ static struct router_info * find_rti(struct ifnet *ifp) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(ifp->if_vnetb); struct router_info *rti; mtx_assert(&igmp_mtx, MA_OWNED); @@ -185,7 +185,6 @@ void igmp_input(register struct mbuf *m, int off) { - INIT_VNET_INET(curvnetb); register int iphlen = off; register struct igmp *igmp; register struct ip *ip; @@ -197,6 +196,7 @@ struct in_multistep step; struct router_info *rti; int timer; /** timer value in the igmp query header **/ + INIT_VNET_INET(ifp->if_vnetb); ++igmpstat.igps_rcv_total; ==== //depot/projects/vimage/src/sys/netinet/in.c#3 (text+ko) ==== @@ -720,7 +720,7 @@ struct sockaddr_in *sin; int scrub; { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(ifp->if_vnetb); register u_long i = ntohl(sin->sin_addr.s_addr); struct sockaddr_in oldaddr; int s = splimp(), flags = RTF_UP, error = 0; @@ -998,7 +998,7 @@ register struct in_addr *ap; register struct ifnet *ifp; { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(ifp->if_vnetb); register struct in_multi *inm; int error; @@ -1107,7 +1107,7 @@ in_delmulti_ifp(ifp) register struct ifnet *ifp; { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(ifp->if_vnetb); struct in_multi *inm; struct in_multi *oinm; @@ -1129,7 +1129,7 @@ in_ifdetach(ifp) struct ifnet *ifp; { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(ifp->if_vnetb); in_pcbpurgeif0(&V_ripcbinfo, ifp); in_pcbpurgeif0(&V_udbinfo, ifp); ==== //depot/projects/vimage/src/sys/netinet/in_pcb.c#3 (text+ko) ==== @@ -270,7 +270,6 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, u_short *lportp, struct ucred *cred) { - INIT_VNET_INET(curvnetb); struct socket *so = inp->inp_socket; unsigned short *lastport; struct sockaddr_in *sin; @@ -280,6 +279,7 @@ int wild = 0, reuseport = (so->so_options & SO_REUSEPORT); int error, prison = 0; int dorandom; + INIT_VNET_INET(so->so_vnetb); INP_INFO_WLOCK_ASSERT(pcbinfo); INP_LOCK_ASSERT(inp); ==== //depot/projects/vimage/src/sys/netinet/ip_input.c#3 (text+ko) ==== @@ -1604,7 +1604,7 @@ int ip_rsvp_init(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP) ==== //depot/projects/vimage/src/sys/netinet/raw_ip.c#3 (text+ko) ==== @@ -281,7 +281,7 @@ int rip_output(struct mbuf *m, struct socket *so, u_long dst) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct ip *ip; int error; struct inpcb *inp = sotoinpcb(so); @@ -616,7 +616,7 @@ static int rip_attach(struct socket *so, int proto, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -654,7 +654,7 @@ static void rip_detach(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -690,7 +690,7 @@ static void rip_abort(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -706,7 +706,7 @@ static void rip_close(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -722,7 +722,7 @@ static int rip_disconnect(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; if ((so->so_state & SS_ISCONNECTED) == 0) @@ -741,8 +741,8 @@ static int rip_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_NET(curvnetb); - INIT_VNET_INET(curvnetb); + INIT_VNET_NET(so->so_vnetb); + INIT_VNET_INET(so->so_vnetb); struct sockaddr_in *addr = (struct sockaddr_in *)nam; struct inpcb *inp; @@ -776,8 +776,8 @@ static int rip_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_NET(curvnetb); - INIT_VNET_INET(curvnetb); + INIT_VNET_NET(so->so_vnetb); + INIT_VNET_INET(so->so_vnetb); struct sockaddr_in *addr = (struct sockaddr_in *)nam; struct inpcb *inp; @@ -940,7 +940,7 @@ static int rip_sockaddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); return (in_setsockaddr(so, nam, &V_ripcbinfo)); } @@ -951,7 +951,7 @@ static int rip_peeraddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); return (in_setpeeraddr(so, nam, &V_ripcbinfo)); } ==== //depot/projects/vimage/src/sys/netinet/tcp_output.c#3 (text+ko) ==== @@ -120,8 +120,8 @@ int tcp_output(struct tcpcb *tp) { - INIT_VNET_INET(curvnetb); struct socket *so = tp->t_inpcb->inp_socket; + INIT_VNET_INET(so->so_vnetb); long len, recwin, sendwin; int off, flags, error; #ifdef TCP_SIGNATURE ==== //depot/projects/vimage/src/sys/netinet/tcp_usrreq.c#3 (text+ko) ==== @@ -152,7 +152,7 @@ static void tcp_detach(struct socket *so, struct inpcb *inp) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct tcpcb *tp; #ifdef INET6 int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0; @@ -247,7 +247,7 @@ static void tcp_usr_detach(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; struct tcpcb *tp; TCPDEBUG0; @@ -272,7 +272,7 @@ static int tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -313,7 +313,7 @@ static int tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -372,7 +372,7 @@ static int tcp_usr_listen(struct socket *so, int backlog, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -409,7 +409,7 @@ static int tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -457,7 +457,7 @@ static int tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -500,7 +500,7 @@ static int tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -573,7 +573,7 @@ static int tcp_usr_disconnect(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; struct tcpcb *tp = NULL; int error = 0; @@ -702,7 +702,7 @@ static int tcp_sockaddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); return (in_setsockaddr(so, nam, &V_tcbinfo)); } @@ -714,7 +714,7 @@ static int tcp_peeraddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); return (in_setpeeraddr(so, nam, &V_tcbinfo)); } @@ -725,7 +725,7 @@ static int tcp_usr_shutdown(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -792,7 +792,7 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -948,7 +948,7 @@ static void tcp_usr_abort(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; struct tcpcb *tp = NULL; TCPDEBUG0; @@ -987,7 +987,7 @@ static void tcp_usr_close(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; struct tcpcb *tp = NULL; TCPDEBUG0; @@ -1121,12 +1121,12 @@ struct sockaddr *nam; struct thread *td; { - INIT_VNET_INET(curvnetb); struct inpcb *inp = tp->t_inpcb, *oinp; struct socket *so = inp->inp_socket; struct in_addr laddr; u_short lport; int error; + INIT_VNET_INET(so->so_vnetb); INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_LOCK_ASSERT(inp); @@ -1176,12 +1176,12 @@ struct sockaddr *nam; struct thread *td; { - INIT_VNET_INET(curvnetb); struct inpcb *inp = tp->t_inpcb, *oinp; struct socket *so = inp->inp_socket; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; struct in6_addr *addr6; int error; + INIT_VNET_INET(so->so_vnetb); INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_LOCK_ASSERT(inp); @@ -1452,7 +1452,7 @@ tcp_attach(so) struct socket *so; { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); register struct tcpcb *tp; struct inpcb *inp; int error; @@ -1514,9 +1514,9 @@ tcp_disconnect(tp) register struct tcpcb *tp; { - INIT_VNET_INET(curvnetb); struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; + INIT_VNET_INET(so->so_vnetb); INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_LOCK_ASSERT(inp); ==== //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#3 (text+ko) ==== @@ -981,7 +981,7 @@ static void udp_abort(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -1000,7 +1000,7 @@ static int udp_attach(struct socket *so, int proto, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -1027,7 +1027,7 @@ static int udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -1044,7 +1044,7 @@ static void udp_close(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -1063,7 +1063,7 @@ static int udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; struct sockaddr_in *sin; @@ -1091,7 +1091,7 @@ static void udp_detach(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -1108,7 +1108,7 @@ static int udp_disconnect(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -1163,7 +1163,7 @@ static int udp_sockaddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); return (in_setsockaddr(so, nam, &V_udbinfo)); } @@ -1175,7 +1175,7 @@ static int udp_peeraddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); return (in_setpeeraddr(so, nam, &V_udbinfo)); } ==== //depot/projects/vimage/src/sys/netinet6/in6_ifattach.c#3 (text+ko) ==== @@ -360,7 +360,7 @@ struct ifnet *altifp; /* secondary EUI64 source */ struct in6_addr *in6; { - INIT_VNET_NET(curvnetb); + INIT_VNET_NET(ifp0->if_vnetb); struct ifnet *ifp; /* first, try to get it from the interface itself */ @@ -734,8 +734,8 @@ in6_ifdetach(ifp) struct ifnet *ifp; { - INIT_VNET_NET(curvnetb); - INIT_VNET_INET(curvnetb); + INIT_VNET_NET(ifp->if_vnetb); + INIT_VNET_INET(ifp->if_vnetb); struct in6_ifaddr *ia, *oia; struct ifaddr *ifa, *next; struct rtentry *rt; ==== //depot/projects/vimage/src/sys/netinet6/in6_pcb.c#3 (text+ko) ==== @@ -562,7 +562,7 @@ int in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -584,7 +584,7 @@ int in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; ==== //depot/projects/vimage/src/sys/netinet6/nd6.c#4 (text+ko) ==== @@ -1197,12 +1197,12 @@ struct rtentry *rt; struct rt_addrinfo *info; /* xxx unused */ { - INIT_VNET_NET(curvnetb); struct sockaddr *gate = rt->rt_gateway; struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; struct ifnet *ifp = rt->rt_ifp; struct ifaddr *ifa; + INIT_VNET_NET(ifp->if_vnetb); RT_LOCK_ASSERT(rt); ==== //depot/projects/vimage/src/sys/netinet6/raw_ip6.c#3 (text+ko) ==== @@ -553,7 +553,7 @@ static int rip6_attach(struct socket *so, int proto, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; struct icmp6_filter *filter; int error; @@ -591,7 +591,7 @@ static void rip6_detach(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -649,8 +649,8 @@ static int rip6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_NET(curvnetb); - INIT_VNET_INET(curvnetb); + INIT_VNET_NET(so->so_vnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp = sotoinpcb(so); struct sockaddr_in6 *addr = (struct sockaddr_in6 *)nam; struct ifaddr *ia = NULL; @@ -684,8 +684,8 @@ static int rip6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_NET(curvnetb); - INIT_VNET_INET(curvnetb); + INIT_VNET_NET(so->so_vnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp = sotoinpcb(so); struct sockaddr_in6 *addr = (struct sockaddr_in6 *)nam; struct in6_addr *in6a = NULL; @@ -757,7 +757,7 @@ rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp = sotoinpcb(so); struct sockaddr_in6 tmp; struct sockaddr_in6 *dst; ==== //depot/projects/vimage/src/sys/netinet6/scope6.c#3 (text+ko) ==== @@ -115,7 +115,7 @@ struct ifnet *ifp; struct scope6_id *idlist; { - INIT_VNET_NET(curvnetb); + INIT_VNET_NET(ifp->if_vnetb); int i; int error = 0; struct scope6_id *sid = NULL; ==== //depot/projects/vimage/src/sys/netinet6/udp6_usrreq.c#3 (text+ko) ==== @@ -485,7 +485,7 @@ static void udp6_abort(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -515,7 +515,7 @@ static int udp6_attach(struct socket *so, int proto, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -554,7 +554,7 @@ static int udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -594,7 +594,7 @@ static void udp6_close(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -623,7 +623,7 @@ static int udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -676,7 +676,7 @@ static void udp6_detach(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; inp = sotoinpcb(so); @@ -692,7 +692,7 @@ static int udp6_disconnect(struct socket *so) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error; @@ -731,7 +731,7 @@ udp6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td) { - INIT_VNET_INET(curvnetb); + INIT_VNET_INET(so->so_vnetb); struct inpcb *inp; int error = 0; ==== //depot/projects/vimage/src/sys/sys/vimage.h#4 (text+ko) ==== @@ -147,7 +147,10 @@ #define VSYM(base, sym) ((base)->_##sym) #define INIT_FROM_VNET_BASE(vnetb, modindex, modtype, sym) \ - VNET_ASSERT(vnetb != 0); \ + if (vnetb != curvnetb) \ + panic("in %s:%d %s()\n vnetb=%p curvnetb=%p", \ + __FILE__, __LINE__, __FUNCTION__, \ + vnetb, curvnetb); \ modtype *sym = (vnetb)->mod_data[modindex]; #define VNETB_ITERLOOP_BEGIN() \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612051503.kB5F3fFe089229>