ref: 3dfe089a7c70145c5da413b7b046eb660284be21
parent: 52f38135b6aaad483aff7cb3218c881a164c2b5d
	author: cinap_lenrek <cinap_lenrek@felloff.net>
	date: Mon Dec 18 15:50:25 EST 2017
	
nusb/ether: dont forward loopback packets on bridges, remove read nonblocking hack
--- a/sys/src/cmd/nusb/ether/ether.c
+++ b/sys/src/cmd/nusb/ether/ether.c
@@ -58,8 +58,6 @@
Block **qt;
int size;
-
- int nb;
};
struct Conn
@@ -262,12 +260,6 @@
d = r->fid->aux;
qlock(d);
-	if(d->q==nil && d->nb){- qunlock(d);
- r->ofcall.count = 0;
- respond(r, nil);
- return;
- }
r->aux = nil;
*d->rt = r;
d->rt = (Req**)&r->aux;
@@ -278,18 +270,12 @@
static void
writeconndata(Req *r)
 {- Dq *d;
void *p;
int n;
Block *b;
- d = r->fid->aux;
p = r->ifcall.data;
n = r->ifcall.count;
-	if((n == 11) && memcmp(p, "nonblocking", n)==0){- d->nb = 1;
- goto out;
- }
/* minimum frame length for rtl8150 */
if(n < 60)
@@ -315,7 +301,6 @@
etheriq(b, 0);
-out:
r->ofcall.count = r->ifcall.count;
respond(r, nil);
}
@@ -725,7 +710,7 @@
qlock(c);
if(!c->used)
goto next;
- if(c->bridge && !wire && !fromme)
+ if(c->bridge && (tome || !wire && !fromme))
goto next;
if(c->type > 0 && c->type != t)
goto next;
--
⑨