~kris/9p

9hist

94daac47a198604080fb419f5adca43782163a05 — David du Colombier 27 years ago 770589c
Plan 9 from Bell Labs 1999-08-03
3 files changed, 16 insertions(+), 7 deletions(-)

M ip/ipifc.c
M port/devbridge.c
M port/devroot.c
M ip/ipifc.c => ip/ipifc.c +10 -3
@@ 1244,6 1244,7 @@ ipifcregisterproxy(Fs *f, Ipifc *ifc, uchar *ip)
	Conv **cp, **e;
	Ipifc *nifc;
	Iplifc *lifc;
	Medium *m;
	uchar net[IPaddrlen];

	/* register the address on any network that will proxy for us */


@@ 1252,16 1253,22 @@ ipifcregisterproxy(Fs *f, Ipifc *ifc, uchar *ip)
		if(*cp == nil)
			continue;
		nifc = (Ipifc*)(*cp)->ptcl;
		if(nifc->m->areg == nil)
			continue;
		if(nifc == ifc)
			continue;

		rlock(nifc);
		m = nifc->m;
		if(m == nil || m->areg == nil){
			runlock(nifc);
			continue;
		}
		for(lifc = nifc->lifc; lifc; lifc = lifc->next){
			maskip(ip, lifc->mask, net);
			if(ipcmp(net, lifc->remote) == 0){
				(*nifc->m->areg)(nifc, ip);
				(*m->areg)(nifc, ip);
				break;
			}
		}
		runlock(nifc);
	}
}

M port/devbridge.c => port/devbridge.c +5 -3
@@ 799,7 799,7 @@ etherread(void *a)
	Block *bp, *bp2;
	Etherpkt *ep;
	Centry *ce;

static uchar tribble[Eaddrlen] = {0x00, 0xd1, 0x80, 0xaa, 0xbb, 0x07};
	
	qlock(b);
	port->readp = up;	/* hide identity under a rock for unbind */


@@ 841,8 841,10 @@ etherread(void *a)
			if(ce == nil) {
				b->miss++;
				port->inunknown++;
				bp2 = bp; bp = nil;
				ethermultiwrite(b, bp2, port);
				if(port->type != Tether || memcmp(ep->s, tribble, Eaddrlen) == 0) {
					bp2 = bp; bp = nil;
					ethermultiwrite(b, bp2, port);
				}	
			} else if (ce->port != port->id) {
				b->hit++;
				bp2 = bp; bp = nil;

M port/devroot.c => port/devroot.c +1 -1
@@ 76,7 76,7 @@ addrootfile(char *name, uchar *contents, ulong len)
static void
addrootdir(char *name)
{
	addroot(name, nil, 0, CHDIR);
	addroot(name, nil, 0, CHDIR|0555);
}

static void