M ip/devip.c => ip/devip.c +1 -2
@@ 367,8 367,7 @@ ipopen(Chan* c, int omode)
int perm;
Fs *f;
- omode &= 3;
- perm = m2p[omode];
+ perm = m2p[omode&3];
f = ipfs[c->dev];
M ip/ip.c => ip/ip.c +12 -4
@@ 206,7 206,8 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
if(!gating)
eh->vihl = IP_VER|IP_HLEN;
eh->ttl = ttl;
- eh->tos = tos;
+ if(!gating)
+ eh->tos = tos;
if(!canrlock(ifc))
goto free;
@@ 223,8 224,10 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
if(!gating)
hnputs(eh->id, incref(&ip->id));
hnputs(eh->length, len);
- eh->frag[0] = 0;
- eh->frag[1] = 0;
+ if(!gating){
+ eh->frag[0] = 0;
+ eh->frag[1] = 0;
+ }
eh->cksum[0] = 0;
eh->cksum[1] = 0;
hnputs(eh->cksum, ipcsum(&eh->vihl));
@@ 265,7 268,12 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
}
xp->rp += offset;
- for(fragoff = 0; fragoff < dlen; fragoff += seglen) {
+ if(gating)
+ fragoff = nhgets(eh->frag);
+ else
+ fragoff = 0;
+ dlen += fragoff;
+ for(; fragoff < dlen; fragoff += seglen) {
nb = allocb(IPHDR+seglen);
feh = (Iphdr*)(nb->rp);
M pc/devvga.c => pc/devvga.c +1 -2
@@ 65,11 65,10 @@ vgaopen(Chan* c, int omode)
}
static void
-vgaclose(Chan*c)
+vgaclose(Chan*)
{
VGAscr *scr;
- pprint("vgaclose: pid %d, %d, %p\n", up->pid, c->ref, c);
scr = &vgascreen[0];
if (scr && scr->dev && scr->dev->ovlctl) {
static char disable[] = "disable\n";
M pc/vgacyber938x.c => pc/vgacyber938x.c +3 -8
@@ 205,19 205,14 @@ cyber938xcurenable(VGAscr* scr)
vgaxo(Crtx, 0x50, CursorON);
}
-static void
-cyber938xdrawinit(VGAscr *scr)
-{
-}
-
VGAdev vgacyber938xdev = {
"cyber938x",
- 0, /* enable */
- 0, /* disable */
+ nil, /* enable */
+ nil, /* disable */
cyber938xpage, /* page */
cyber938xlinear, /* linear */
- cyber938xdrawinit, /* drawinit */
+ nil, /* drawinit */
};
VGAcur vgacyber938xcur = {
M port/devcons.c => port/devcons.c +3 -0
@@ 426,6 426,9 @@ kbdputc(Queue*, int ch)
Rune r;
char *next;
+ if(kbd.ir == nil)
+ return 0; /* in case we're not inited yet */
+
ilock(&kbd.lockputc); /* just a mutex */
r = ch;
n = runetochar(buf, &r);