diff --git a/sys/src/9/ip/loopbackmedium.c b/sys/src/9/ip/loopbackmedium.c index 38e2fd7ee..c66c31092 100644 --- a/sys/src/9/ip/loopbackmedium.c +++ b/sys/src/9/ip/loopbackmedium.c @@ -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 diff --git a/sys/src/9/ip/netdevmedium.c b/sys/src/9/ip/netdevmedium.c index 74d47290c..25111fd41 100644 --- a/sys/src/9/ip/netdevmedium.c +++ b/sys/src/9/ip/netdevmedium.c @@ -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;