devip: increment in counter *AFTER* acquiering the ifc lock or loopbackmedium
This commit is contained in:
parent
dbf13129a7
commit
8962551055
2 changed files with 2 additions and 3 deletions
|
@ -75,14 +75,13 @@ loopbackread(void *a)
|
|||
lb = ifc->arg;
|
||||
lb->readp = up; /* hide identity under a rock for unbind */
|
||||
if(waserror()){
|
||||
lb->readp = 0;
|
||||
lb->readp = nil;
|
||||
pexit("hangup", 1);
|
||||
}
|
||||
for(;;){
|
||||
bp = qbread(lb->q, Maxtu);
|
||||
if(bp == nil)
|
||||
continue;
|
||||
ifc->in++;
|
||||
if(!canrlock(ifc)){
|
||||
freeb(bp);
|
||||
continue;
|
||||
|
@ -91,6 +90,7 @@ loopbackread(void *a)
|
|||
runlock(ifc);
|
||||
nexterror();
|
||||
}
|
||||
ifc->in++;
|
||||
if(ifc->lifc == nil)
|
||||
freeb(bp);
|
||||
else
|
||||
|
|
|
@ -117,7 +117,6 @@ netdevread(void *a)
|
|||
/*
|
||||
* get here if mchan is a pipe and other side hangs up
|
||||
* clean up this interface & get out
|
||||
ZZZ is this a good idea?
|
||||
*/
|
||||
poperror();
|
||||
er->readp = nil;
|
||||
|
|
Loading…
Reference in a new issue