Browse Source

Plan 9 from Bell Labs 2010-11-30

David du Colombier 13 years ago
parent
commit
e87470b521

+ 4 - 4
rc/bin/termrc

@@ -56,11 +56,11 @@ if(! ~ $terminal *vx32*){
 	if(! ps|grep -s timesync)
 		if(! ~ $TIMESYNCARGS '')
 			aux/timesync $TIMESYNCARGS
-	
-	# add the loop-back device
-	if(grep -s loopback /dev/drivers)
+
+	# add the loop-back medium
+	if(! grep -s 127.0.0.1 /net/ipselftab)
 		ip/ipconfig loopback /dev/null 127.1
-	
+
 	# set things up for vmware
 	if(! ~ `{cat /dev/user} none)
 		if(test -e /bin/aux/vmware)

+ 1 - 1
sys/src/9/pc/mkfile

@@ -1,5 +1,5 @@
 CONF=pc
-CONFLIST=pc pccpu pcf pccpuf pcdisk pcauth
+CONFLIST=pc pccpu pcf pcdisk # pccpuf pcauth
 CRAPLIST=pccd pcflop
 EXTRACOPIES=
 #EXTRACOPIES=lookout boundary	# copy to these servers on install

+ 7 - 7
sys/src/9/port/devssl.c

@@ -73,15 +73,15 @@ struct Dstate
 enum
 {
 	Maxdmsg=	1<<16,
-	Maxdstate=	128,	/* must be a power of 2 */
+	Maxdstate=	512,	/* max. open ssl conn's; must be a power of 2 */
 };
 
-Lock	dslock;
-int	dshiwat;
-char	*dsname[Maxdstate];
-Dstate	*dstate[Maxdstate];
-char	*encalgs;
-char	*hashalgs;
+static	Lock	dslock;
+static	int	dshiwat;
+static	char	*dsname[Maxdstate];
+static	Dstate	*dstate[Maxdstate];
+static	char	*encalgs;
+static	char	*hashalgs;
 
 enum{
 	Qtopdir		= 1,	/* top level directory */

+ 11 - 4
sys/src/cmd/ip/pppoe.c

@@ -389,10 +389,17 @@ wantsession(uchar *pkt)
 	if(findtag(pkt, TagAcSysErr, &len, 0))
 		return bad("ac system error");
 
-	if((s = findtag(pkt, TagSrvName, &len, 0)) == nil)
-		return bad("no matching service name");
-	if(len != strlen(srvname) || memcmp(s, srvname, len) != 0)
-		return bad("no matching service name");
+	/*
+	 * rsc said: ``if there is no -S option given, the current code
+	 * waits for an offer with service name == "".
+	 * that's silly.  it should take the first one it gets.''
+	 */
+	if(srvname[0] != '\0') {
+		if((s = findtag(pkt, TagSrvName, &len, 0)) == nil)
+			return bad("no matching service name");
+		if(len != strlen(srvname) || memcmp(s, srvname, len) != 0)
+			return bad("no matching service name");
+	}
 	sessid = nhgets(ph->sessid);
 	return 1;
 }

+ 9 - 2
sys/src/cmd/ndb/dn.c

@@ -741,9 +741,16 @@ rrattach1(RR *new, int auth)
 	assert(new->magic == RRmagic && !new->cached);
 
 //	dnslog("rrattach1: %s", new->owner->name);
-	if(!new->db)
+	if(!new->db) {
 		new->expire = new->ttl;		/* ? */
-	else
+		/*
+		 * try not to let responses expire before we
+		 * can use them to complete this query, by extending
+		 * past expiration time.
+		 */
+		if(new->expire <= now - 60)
+			new->expire = now + 10*Min;
+	} else
 		new->expire = now + Year;
 	dp = new->owner;
 	assert(dp->magic == DNmagic);

+ 2 - 2
sys/src/cmd/usb/audio/audiofs.c

@@ -154,7 +154,7 @@ post(char *name, char *envname, int srvfd)
 	fd = create(name, OWRITE, attachok?0666:0600);
 	if(fd < 0)
 		return;
-	sprint(buf, "%d",srvfd);
+	snprint(buf, sizeof buf, "%d", srvfd);
 	if(write(fd, buf, strlen(buf)) != strlen(buf))
 		sysfatal("srv write");
 	close(fd);
@@ -202,7 +202,7 @@ serve(void *)
 
 	close(p[0]);	/* don't deadlock if child fails */
 	if(srvpost){
-		sprint(srvfile, "/srv/%s", srvpost);
+		snprint(srvfile, sizeof srvfile, "/srv/%s", srvpost);
 		remove(srvfile);
 		post(srvfile, "usbaudio", p[1]);
 	}

+ 1 - 2
sys/src/cmd/usb/disk/scsireq.c

@@ -892,8 +892,7 @@ SRopenraw(ScsiReq *rp, char *unit)
 	memset(rp, 0, sizeof *rp);
 	rp->unit = unit;
 
-	sprint(name, "%s/raw", unit);
-
+	snprint(name, sizeof name, "%s/raw", unit);
 	if((rp->fd = open(name, ORDWR)) == -1){
 		rp->status = STtimeout;
 		return -1;

+ 1 - 1
sys/src/cmd/usb/ether/ether.c

@@ -323,7 +323,7 @@ filldir(Usbfs *fs, Dir *d, Dirtab *tab, int cn)
 	else
 		d->qid.type = QTFILE;
 	if(tab->qid == Qndir)
-		sprint(d->name, "%d", cn);
+		snprint(d->name, Namesz, "%d", cn);
 	else
 		d->name = tab->name;
 }