Date: Fri, 15 Dec 2006 19:49:16 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 111749 for review Message-ID: <200612151949.kBFJnGBW016848@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111749 Change 111749 by zec@zec_tpx32 on 2006/12/15 19:48:49 Add virtualization support for ppp(4). Affected files ... .. //depot/projects/vimage/src/sys/kern/tty.c#3 edit .. //depot/projects/vimage/src/sys/net/if_ppp.c#3 edit Differences ... ==== //depot/projects/vimage/src/sys/kern/tty.c#3 (text+ko) ==== @@ -75,6 +75,7 @@ #include "opt_compat.h" #include "opt_tty.h" +#include "opt_vimage.h" #include <sys/param.h> #include <sys/systm.h> @@ -104,6 +105,7 @@ #include <sys/sched.h> #include <sys/sysctl.h> #include <sys/timepps.h> +#include <sys/vimage.h> #include <machine/stdarg.h> @@ -1139,6 +1141,7 @@ if (t == tp->t_line) return (0); s = spltty(); + CURVNETB_SET(curthread->td_vimage->v_vnetb); /* XXX */ ttyld_close(tp, flag); tp->t_line = t; /* XXX: we should use the correct cdev here */ @@ -1154,6 +1157,7 @@ tp->t_line = TTYDISC; (void)ttyld_open(tp, tp->t_dev); } + CURVNETB_RESTORE(); splx(s); return (error); break; @@ -3127,7 +3131,9 @@ goto out; goto open_top; } + CURVNETB_SET(curthread->td_vimage->v_vnetb); /* XXX */ error = ttyld_open(tp, dev); + CURVNETB_RESTORE(); ttyldoptim(tp); if (tp->t_state & TS_ISOPEN && ISCALLOUT(dev)) tp->t_actout = TRUE; @@ -3144,7 +3150,9 @@ struct tty *tp; tp = dev->si_tty; + CURVNETB_SET(curthread->td_vimage->v_vnetb); /* XXX */ ttyld_close(tp, flag); + CURVNETB_RESTORE(); ttyldoptim(tp); tt_close(tp); tp->t_do_timestamp = 0; ==== //depot/projects/vimage/src/sys/net/if_ppp.c#3 (text+ko) ==== @@ -80,6 +80,7 @@ #include "opt_ipx.h" #include "opt_mac.h" #include "opt_ppp.h" +#include "opt_vimage.h" #ifdef INET #define VJC @@ -98,6 +99,7 @@ #include <sys/time.h> #include <sys/malloc.h> #include <sys/module.h> +#include <sys/vimage.h> #include <net/if.h> #include <net/if_clone.h> @@ -1395,6 +1397,7 @@ struct mbuf *mp, *dmp = NULL; u_char *iphdr; u_int hlen; + CURVNETB_SET(ifp->if_vnetb); sc->sc_stats.ppp_ipackets++; @@ -1429,7 +1432,7 @@ m_freem(m); if (dmp == NULL) { /* no error, but no decompressed packet produced */ - return; + goto done; } m = dmp; cp = mtod(m, u_char *); @@ -1586,7 +1589,7 @@ ilen, 0) == 0) { /* drop this packet */ m_freem(m); - return; + goto done; } if (sc->sc_active_filt.bf_insns == 0 || bpf_filter(sc->sc_active_filt.bf_insns, (u_char *) m, ilen, 0)) @@ -1615,13 +1618,13 @@ || sc->sc_npmode[NP_IP] != NPMODE_PASS) { /* interface is down - drop the packet. */ m_freem(m); - return; + goto done; } m->m_pkthdr.len -= PPP_HDRLEN; m->m_data += PPP_HDRLEN; m->m_len -= PPP_HDRLEN; if ((m = ip_fastforward(m)) == NULL) - return; + goto done; isr = NETISR_IP; break; #endif @@ -1634,7 +1637,7 @@ || sc->sc_npmode[NP_IPV6] != NPMODE_PASS) { /* interface is down - drop the packet. */ m_freem(m); - return; + goto done; } m->m_pkthdr.len -= PPP_HDRLEN; m->m_data += PPP_HDRLEN; @@ -1651,7 +1654,7 @@ /* XXX: || sc->sc_npmode[NP_IPX] != NPMODE_PASS*/) { /* interface is down - drop the packet. */ m_freem(m); - return; + goto done; } m->m_pkthdr.len -= PPP_HDRLEN; m->m_data += PPP_HDRLEN; @@ -1686,6 +1689,8 @@ if (isr == -1) (*sc->sc_ctlp)(sc); + done: + CURVNETB_RESTORE(); return; bad: @@ -1693,6 +1698,7 @@ m_freem(m); PPP2IFP(sc)->if_ierrors++; sc->sc_stats.ppp_ierrors++; + CURVNETB_RESTORE(); } #define MAX_DUMP_BYTES 128
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612151949.kBFJnGBW016848>