Browse Source

Plan 9 from Bell Labs 2007-06-01

David du Colombier 14 years ago
parent
commit
964ca55431

+ 6 - 5
dist/replica/_plan9.db

@@ -5499,7 +5499,7 @@ rc/bin/dosmnt - 775 sys sys 1109288224 303
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1127394677 2385
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1177742142 1658
+rc/bin/fshalt - 775 sys sys 1180592582 1669
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427
@@ -7767,7 +7767,7 @@ sys/man/7/playlistfs - 664 sys sys 1103794042 3831
 sys/man/7/scat - 664 sys sys 970069855 8904
 sys/man/8 - 20000000775 sys sys 1162240005 0
 sys/man/8/0intro - 664 sys sys 944959679 247
-sys/man/8/6in4 - 664 sys sys 1179779762 1655
+sys/man/8/6in4 - 664 sys sys 1180653391 1850
 sys/man/8/9load - 664 sys sys 1094676489 9170
 sys/man/8/9pcon - 664 sys sys 1145881850 2234
 sys/man/8/INDEX - 664 sys sys 1178249215 2888
@@ -8168,7 +8168,7 @@ sys/src/9/port/devcons.c - 664 sys sys 1176658321 22943
 sys/src/9/port/devdraw.c - 664 sys sys 1147023550 44447
 sys/src/9/port/devdup.c - 664 sys sys 1014931172 2332
 sys/src/9/port/devenv.c - 664 sys sys 1169498893 7015
-sys/src/9/port/devfs.c - 664 sys sys 1180249924 13409
+sys/src/9/port/devfs.c - 664 sys sys 1180592541 13499
 sys/src/9/port/devkbmap.c - 664 sys sys 1130763846 3064
 sys/src/9/port/devkprof.c - 664 sys sys 1014931173 3111
 sys/src/9/port/devloopback.c - 664 sys sys 1138458368 14579
@@ -12463,7 +12463,7 @@ sys/src/cmd/iostats/mkfile - 664 sys sys 1014925727 122
 sys/src/cmd/iostats/statfs.h - 664 sys sys 1140099908 2626
 sys/src/cmd/iostats/statsrv.c - 664 sys sys 1166824341 10773
 sys/src/cmd/ip - 20000000775 sys sys 1128605981 0
-sys/src/cmd/ip/6in4.c - 664 sys sys 1179783180 7341
+sys/src/cmd/ip/6in4.c - 664 sys sys 1180652319 7570
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
 sys/src/cmd/ip/dhcp.h - 664 sys sys 1178483074 3419
 sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1178482836 11969
@@ -12609,7 +12609,7 @@ sys/src/cmd/ip/telnet.c - 664 sys sys 1162416789 8621
 sys/src/cmd/ip/telnet.h - 664 sys sys 1015090250 5902
 sys/src/cmd/ip/telnetd.c - 664 sys sys 1135487948 11772
 sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
-sys/src/cmd/ip/traceroute.c - 664 sys sys 1179779560 8645
+sys/src/cmd/ip/traceroute.c - 664 sys sys 1180651317 8699
 sys/src/cmd/ip/udpecho.c - 664 sys sys 1178483004 789
 sys/src/cmd/join.c - 664 sys sys 1158251357 7550
 sys/src/cmd/jpg - 20000000775 sys sys 1132458749 0
@@ -15838,3 +15838,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/ip/traceroute - 775 sys sys 1180668259 72750

+ 6 - 6
dist/replica/plan9.db

@@ -317,7 +317,7 @@
 386/bin/ip/rlogind - 775 sys sys 1178568290 66192
 386/bin/ip/telnetd - 775 sys sys 1179372096 121990
 386/bin/ip/tftpd - 775 sys sys 1179372096 130740
-386/bin/ip/traceroute - 775 sys sys 1179804021 72750
+386/bin/ip/traceroute - 775 sys sys 1180668259 72750
 386/bin/ip/udpecho - 775 sys sys 1178508500 43095
 386/bin/join - 775 sys sys 1168402330 114382
 386/bin/jpg - 775 sys sys 1179372097 174971
@@ -5499,7 +5499,7 @@ rc/bin/dosmnt - 775 sys sys 1109288224 303
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1127394677 2385
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1177742142 1658
+rc/bin/fshalt - 775 sys sys 1180592582 1669
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427
@@ -7767,7 +7767,7 @@ sys/man/7/playlistfs - 664 sys sys 1103794042 3831
 sys/man/7/scat - 664 sys sys 970069855 8904
 sys/man/8 - 20000000775 sys sys 1162240005 0
 sys/man/8/0intro - 664 sys sys 944959679 247
-sys/man/8/6in4 - 664 sys sys 1179779762 1655
+sys/man/8/6in4 - 664 sys sys 1180653391 1850
 sys/man/8/9load - 664 sys sys 1094676489 9170
 sys/man/8/9pcon - 664 sys sys 1145881850 2234
 sys/man/8/INDEX - 664 sys sys 1178249215 2888
@@ -8168,7 +8168,7 @@ sys/src/9/port/devcons.c - 664 sys sys 1176658321 22943
 sys/src/9/port/devdraw.c - 664 sys sys 1147023550 44447
 sys/src/9/port/devdup.c - 664 sys sys 1014931172 2332
 sys/src/9/port/devenv.c - 664 sys sys 1169498893 7015
-sys/src/9/port/devfs.c - 664 sys sys 1180249924 13409
+sys/src/9/port/devfs.c - 664 sys sys 1180592541 13499
 sys/src/9/port/devkbmap.c - 664 sys sys 1130763846 3064
 sys/src/9/port/devkprof.c - 664 sys sys 1014931173 3111
 sys/src/9/port/devloopback.c - 664 sys sys 1138458368 14579
@@ -12463,7 +12463,7 @@ sys/src/cmd/iostats/mkfile - 664 sys sys 1014925727 122
 sys/src/cmd/iostats/statfs.h - 664 sys sys 1140099908 2626
 sys/src/cmd/iostats/statsrv.c - 664 sys sys 1166824341 10773
 sys/src/cmd/ip - 20000000775 sys sys 1128605981 0
-sys/src/cmd/ip/6in4.c - 664 sys sys 1179783180 7341
+sys/src/cmd/ip/6in4.c - 664 sys sys 1180652319 7570
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
 sys/src/cmd/ip/dhcp.h - 664 sys sys 1178483074 3419
 sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1178482836 11969
@@ -12609,7 +12609,7 @@ sys/src/cmd/ip/telnet.c - 664 sys sys 1162416789 8621
 sys/src/cmd/ip/telnet.h - 664 sys sys 1015090250 5902
 sys/src/cmd/ip/telnetd.c - 664 sys sys 1135487948 11772
 sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
-sys/src/cmd/ip/traceroute.c - 664 sys sys 1179779560 8645
+sys/src/cmd/ip/traceroute.c - 664 sys sys 1180651317 8699
 sys/src/cmd/ip/udpecho.c - 664 sys sys 1178483004 789
 sys/src/cmd/join.c - 664 sys sys 1158251357 7550
 sys/src/cmd/jpg - 20000000775 sys sys 1132458749 0

+ 7 - 0
dist/replica/plan9.log

@@ -49114,3 +49114,10 @@
 1180468823 0 c 386/bin/auth/secstore - 775 sys sys 1180468712 195983
 1180468823 1 c 386/bin/auth/secstored - 775 sys sys 1180468713 197571
 1180468823 2 c 386/bin/auth/secuser - 775 sys sys 1180468714 152765
+1180593023 0 c rc/bin/fshalt - 775 sys sys 1180592582 1669
+1180593023 1 c sys/src/9/port/devfs.c - 664 sys sys 1180592541 13499
+1180652423 0 c sys/man/8/6in4 - 664 sys sys 1180652322 1854
+1180652423 1 c sys/src/cmd/ip/6in4.c - 664 sys sys 1180652319 7570
+1180652423 2 c sys/src/cmd/ip/traceroute.c - 664 sys sys 1180651317 8699
+1180654222 0 c sys/man/8/6in4 - 664 sys sys 1180653391 1850
+1180668640 0 c 386/bin/ip/traceroute - 775 sys sys 1180668259 72750

+ 2 - 1
rc/bin/fshalt

@@ -35,7 +35,8 @@ for(i in $f) @ {
 }
 
 echo -n venti...
-venti/sync >[2]/dev/null
+venti/sync >[2]/dev/null &
+sleep 30
 
 for (i in $k){
 	echo -n $i... 

+ 21 - 7
sys/man/8/6in4

@@ -8,9 +8,9 @@
 ] [
 .B -x
 .I netmtpt
-]
+] [
 .IB local6[ / mask]
-[
+] [
 .I remote4
 [
 .I remote6
@@ -39,6 +39,21 @@ is the IPv6 address of the far end of the tunnel
 (used as the point-to-point destination for routing, and
 defaults to a link-local address constructed from
 .IR remote4 ).
+If
+.I local6
+is missing,
+it defaults to
+.BI 2002: aabb : ccdd ::1/48 ,
+where
+.IR aa ,
+.IR bb ,
+.I cc
+and
+.I dd
+are the hexadecimal equivalents of the bytes
+.IB a . b . c .\c
+.I d
+in this host's primary IPv4 address.
 .PP
 Supply
 .B -g
@@ -49,17 +64,16 @@ uses the network mounted at
 instead of
 .LR /net .
 .SH EXAMPLES
-If your public IPv6 address is
-.LR 1.2.3.4,
+If your primary IPv4 address is public,
 you can start a 6to4 tunnel simply with
 .IP
 .EX
-6in4 -g 2002:0102:0304::1/48
+6in4 -g
 .EE
 .PP
 If you use a tunnel broker at address
-.LR 5.6.7.8 , configured to
-give you a
+.LR 5.6.7.8 ,
+configured to give you a
 .L /64
 subnet with address
 .LR 2001:1122:3344:5566:: ,

+ 10 - 4
sys/src/9/port/devfs.c

@@ -599,7 +599,7 @@ mread(Chan *c, void *a, long n, vlong off)
 static long
 mwrite(Chan *c, void *a, long n, vlong off)
 {
-	int	i, allbad, retry;
+	int	i, allbad, anybad, retry;
 	long	l, res;
 	Fsdev	*mp;
 	Inner	*in;
@@ -642,17 +642,23 @@ mwrite(Chan *c, void *a, long n, vlong off)
 				tsleep(&up->sleep, return0, 0, 2000);
 			}
 			allbad = 1;
+			anybad = 0;
 			for (i = mp->ndevs - 1; i >= 0; i--){
-				if (waserror())
+				if (waserror()) {
+					anybad = 1;
 					continue;
+				}
 				in = &mp->inner[i];
 				l = io(mp, in, Iswrite, a, n, off);
 				poperror();
 				if (res > l)
 					res = l;	/* shortest OK write */
-				allbad = 0;		/* wrote a good copy */
+				if (l == n)
+					allbad = 0;	/* wrote a good copy */
+				else
+					anybad = 1;
 			}
-		} while (allbad && ++retry < 2);
+		} while (anybad && ++retry < 2);
 		if (allbad) {
 			/* no mirror took a good copy of the block */
 			print("#k/%s: byte %,lld count %ld: CAN'T WRITE "

+ 19 - 9
sys/src/cmd/ip/6in4.c

@@ -33,7 +33,7 @@ static void	tunnel2ip(int, int);
 static void
 usage(void)
 {
-	fprint(2, "Usage: %s [-ag] [-x mtpt] local6[/mask] [remote4 [remote6]]\n",
+	fprint(2, "usage: %s [-ag] [-x mtpt] [local6[/mask]] [remote4 [remote6]]\n",
 		argv0);
 	exits("Usage");
 }
@@ -42,7 +42,7 @@ void
 main(int argc, char **argv)
 {
 	int n, tunnel, ifc, cfd;
-	char *p, *cl, *ir;
+	char *p, *cl, *ir, *loc6;
 	char buf[128], path[64];
 
 	fmtinstall('I', eipfmt);
@@ -62,20 +62,32 @@ main(int argc, char **argv)
 	default:
 		usage();
 	} ARGEND
+
+	if (myipaddr(myip, net) < 0)
+		sysfatal("can't find my ipv4 address on %s", net);
+
 	if (argc < 1)
-		usage();
+		loc6 = smprint("2002:%2.2x%2.2x:%2.2x%2.2x::1/48",
+			myip[IPaddrlen - IPv4addrlen],
+			myip[IPaddrlen - IPv4addrlen + 1],
+			myip[IPaddrlen - IPv4addrlen + 2],
+			myip[IPaddrlen - IPv4addrlen + 3]);
+	else {
+		loc6 = argv[0];
+		argv++;
+		argc--;
+	}
 
 	/* local v6 address (mask defaults to /128) */
 	memcpy(localmask, IPallbits, sizeof localmask);
-	if ((p = strchr(argv[0], '/')) != nil) {
+	p = strchr(loc6, '/');
+	if (p != nil) {
 		parseipmask(localmask, p);
 		*p = 0;
 	}
-	parseip(local6, argv[0]);
+	parseip(local6, loc6);
 	if (isv4(local6))
 		usage();
-	argv++;
-	argc--;
 	if (argc >= 1 && argv[0][0] == '/') {
 		parseipmask(localmask, argv[0]);
 		argv++;
@@ -111,8 +123,6 @@ main(int argc, char **argv)
 		usage();
 
 	maskip(local6, localmask, localnet);
-	if (myipaddr(myip, net) < 0)
-		sysfatal("can't find my ipv4 address on %s", net);
 
 	/*
 	 * open IPv6-in-IPv4 tunnel

+ 2 - 1
sys/src/cmd/ip/traceroute.c

@@ -437,7 +437,8 @@ main(int argc, char **argv)
 		}
 		if(notranslate == 1 || dodnsquery(&ds, hop, dom) < 0)
 			dom[0] = 0;
-		print("%-18.18s %8ld %8ld %8ld %s\n", hop, lo, sum/tries, hi, dom);
+		/* don't truncate: ipv6 addresses can be quite long */
+		print("%-18s %8ld %8ld %8ld %s\n", hop, lo, sum/tries, hi, dom);
 		if(buckets)
 			histogram(t, tries, buckets, lo, hi);
 		if(done)