M pc/devether.c => pc/devether.c +9 -8
@@ 95,7 95,7 @@ etherwstat(Chan *c, char *dp)
}
void
-etherrloop(Ether *ctlr, Etherpkt *pkt, long len)
+etherrloop(Ether *ctlr, Etherpkt *pkt, long len, int tome)
{
ushort type;
Netfile *f, **fp, **ep;
@@ 103,7 103,7 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len)
type = (pkt->type[0]<<8)|pkt->type[1];
ep = &ctlr->f[Ntypes];
for(fp = ctlr->f; fp < ep; fp++){
- if((f = *fp) && (f->type == type || f->type < 0))
+ if((f = *fp) && ((tome && f->type==type) || f->type < 0))
qproduce(f->in, pkt->d, len);
}
}
@@ 111,17 111,18 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len)
static int
etherwloop(Ether *ctlr, Etherpkt *pkt, long len)
{
- int s, different;
+ int s, tome, bcast;
- different = memcmp(pkt->d, pkt->s, sizeof(pkt->s));
- if(different && memcmp(pkt->d, ctlr->bcast, sizeof(pkt->d))
- && ctlr->prom==0 && ctlr->all==0)
+ tome = memcmp(pkt->d, ctlr->ea, sizeof(pkt->d)) == 0;
+ bcast = memcmp(pkt->d, ctlr->bcast, sizeof(pkt->d)) == 0;
+ if(!tome && !bcast && ctlr->prom==0 && ctlr->all==0)
return 0;
s = splhi();
- etherrloop(ctlr, pkt, len);
+ etherrloop(ctlr, pkt, len, tome||bcast);
splx(s);
- return !different;
+
+ return tome;
}
long
M pc/devvga.c => pc/devvga.c +4 -4
@@ 217,8 217,8 @@ vgaread(Chan *c, void *buf, long n, ulong offset)
return readstr(offset, buf, n, cbuf);
case Qvgaiob:
port = offset;
- if(checkvgaport(port, n))
- error(Eperm);
+ /*if(checkvgaport(port, n))
+ error(Eperm);*/
for(cp = buf; port < offset+n; port++)
*cp++ = vgai(port);
return n;
@@ 330,8 330,8 @@ vgawrite(Chan *c, void *buf, long n, ulong offset)
return n;
case Qvgaiob:
port = offset;
- if(checkvgaport(port, n))
- error(Eperm);
+ /*if(checkvgaport(port, n))
+ error(Eperm);*/
for(cp = buf; port < offset+n; port++)
vgao(port, *cp++);
return n;
M pc/etherif.h => pc/etherif.h +1 -1
@@ 22,7 22,7 @@ struct Ether {
Netif;
};
-extern void etherrloop(Ether*, Etherpkt*, long);
+extern void etherrloop(Ether*, Etherpkt*, long, int);
extern void addethercard(char*, int(*)(Ether*));
/*