From c89376ede14f73a295fec4a0bf73df786dcf3193 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 6 Jan 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-01-06 --- port/devip.c | 2 ++ port/stil.c | 8 +++++--- port/tcpinput.c | 6 ++++++ power/mmu.c | 4 +--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/port/devip.c b/port/devip.c index 2681e2f95f5373ddae8631e15878e5dfea0be397..3f0ff5b68585cae393c03685a9eae9fbe1e20d82 100644 --- a/port/devip.c +++ b/port/devip.c @@ -429,6 +429,8 @@ udpstoput(Queue *q, Block *bp) ptcllen = dlen + (UDP_HDRSIZE-UDP_PHDRSIZE); uh->Unused = 0; uh->udpproto = IP_UDPPROTO; + uh->frag[0] = 0; + uh->frag[1] = 0; hnputs(uh->udpplen, ptcllen); hnputl(uh->udpdst, ipc->dst); hnputl(uh->udpsrc, Myip); diff --git a/port/stil.c b/port/stil.c index 1848811ff36a923f4ae69bd7ee396565adb76f94..41ee9bba86e39a7f2054f3b4e79bea5afae53dbd 100644 --- a/port/stil.c +++ b/port/stil.c @@ -152,6 +152,8 @@ iloput(Queue *q, Block *bp) ih = (Ilhdr *)(bp->rptr); /* Ip fields */ + ih->frag[0] = 0; + ih->frag[1] = 0; hnputl(ih->src, Myip); hnputl(ih->dst, ipc->dst); ih->proto = IP_ILPROTO; @@ -292,7 +294,7 @@ ilrcvmsg(Ipconv *ipc, Block *bp) ic = &new->ilctl; ic->state = Ilsyncee; initseq += TK2MS(MACHP(0)->ticks); - ic->start = initseq; + ic->start = initseq & 0xffffff; ic->next = ic->start+1; ic->recvd = 0; ic->rstart = nhgetl(ih->ilid); @@ -467,7 +469,7 @@ _ilprocess(Ipconv *s, Ilhdr *h, Block *bp) void ilrexmit(Ilcb *ic) { - Block *nb; + Block *nb, *bp; Ilhdr *h; nb = 0; @@ -750,7 +752,7 @@ ilstart(Ipconv *ipc, int type, int window) initseq += TK2MS(MACHP(0)->ticks); - ic->start = initseq; + ic->start = initseq & 0xffffff; ic->next = ic->start+1; ic->recvd = 0; ic->window = window; diff --git a/port/tcpinput.c b/port/tcpinput.c index 313e5f2350efabca60e7fb4a7bdb875c53c5d187..c10a1a8b270811be00e14051e8c94adcd1b4a977 100644 --- a/port/tcpinput.c +++ b/port/tcpinput.c @@ -798,6 +798,8 @@ copyb(Block *bp, int count) memmove(nb->wptr, bp->rptr, l); nb->wptr += l; count -= l; + if(bp->flags & S_DELIM) + nb->flags |= S_DELIM; *p = nb; p = &nb->next; bp = bp->next; @@ -810,10 +812,12 @@ copyb(Block *bp, int count) panic("copyb.2"); memset(nb->wptr, 0, count); nb->wptr += count; + nb->flags |= S_DELIM; *p = nb; } if(blen(head) == 0) print("copyb: zero length\n"); + return head; } @@ -964,6 +968,8 @@ htontcp(Tcp *tcph, Block *data, Tcphdr *ph) h = (Tcphdr *)(data->rptr); h->proto = IP_TCPPROTO; + h->frag[0] = 0; + h->frag[1] = 0; hnputs(h->tcplen, hdrlen + dlen); hnputs(h->tcpsport, tcph->source); hnputs(h->tcpdport, tcph->dest); diff --git a/power/mmu.c b/power/mmu.c index fa5a9eee320c7c597382df6336c511c1a1ee62a5..40308e38b2fb3d99d801af1a83bd31e5c2846bbb 100644 --- a/power/mmu.c +++ b/power/mmu.c @@ -156,9 +156,7 @@ void flushmmu(void) { splhi(); - /* easiest is to forget what pid we had.... */ - memset(u->p->pidonmach, 0, sizeof u->p->pidonmach); - /* ....then get a new one by trying to map our stack */ + u->p->newtlb = 1; mapstack(u->p); spllo(); }