devip: increment in counter *AFTER* acquiering the ifc lock or loopbackmedium

This commit is contained in:
cinap_lenrek 2018-04-22 18:50:11 +02:00
parent dbf13129a7
commit 8962551055
2 changed files with 2 additions and 3 deletions

View file

@ -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

View file

@ -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;