Browse Source

Plan 9 from Bell Labs 2007-12-21

David du Colombier 13 years ago
parent
commit
0ebdf57a1a

+ 16 - 15
dist/replica/_plan9.db

@@ -36,7 +36,7 @@
 386/bin/ape/stty - 775 sys sys 1148500571 41080
 386/bin/ape/tar - 775 sys sys 1168402264 62184
 386/bin/ape/uname - 775 sys sys 1173754552 134895
-386/bin/aquarela - 775 sys sys 1197732624 337700
+386/bin/aquarela - 775 sys sys 1198183082 337692
 386/bin/ar - 775 sys sys 1178939751 114363
 386/bin/archfs - 775 sys sys 1179372067 146788
 386/bin/ascii - 775 sys sys 1168402265 64884
@@ -260,7 +260,7 @@
 386/bin/games/jukefs - 775 sys sys 1196742485 164538
 386/bin/games/mahjongg - 775 sys sys 1197732724 165258
 386/bin/games/memo - 775 sys sys 1197732727 156672
-386/bin/games/mp3dec - 775 sys sys 1196207154 355822
+386/bin/games/mp3dec - 775 sys sys 1198183090 388585
 386/bin/games/mp3enc - 775 sys sys 1196220182 530357
 386/bin/games/playlistfs - 775 sys sys 1196742488 148960
 386/bin/games/sokoban - 775 sys sys 1197732730 165530
@@ -6099,7 +6099,7 @@ sys/include/frame.h - 664 sys sys 1196212617 2708
 sys/include/geometry.h - 664 sys sys 1014929063 2632
 sys/include/html.h - 664 sys sys 1184472600 15622
 sys/include/httpd.h - 664 sys sys 1190835025 5800
-sys/include/ip.h - 664 sys sys 1187047442 4383
+sys/include/ip.h - 664 sys sys 1198184776 4401
 sys/include/keyboard.h - 664 sys sys 1131637696 865
 sys/include/libc.h - 664 sys sys 1168306860 19851
 sys/include/libsec.h - 664 sys sys 1188328413 8684
@@ -7354,7 +7354,6 @@ sys/man/1/INDEX.html - 664 sys sys 1196638934 16845
 sys/man/1/acid - 664 sys sys 1196638934 9730
 sys/man/1/acme - 664 sys sys 1196638934 18540
 sys/man/1/ap - 664 sys sys 1196638934 364
-sys/man/1/aquarela - 664 sys sys 1196895084 2770
 sys/man/1/ar - 664 sys sys 1196638934 3153
 sys/man/1/ascii - 664 sys sys 1196638934 2726
 sys/man/1/awk - 664 sys sys 1196638934 10881
@@ -7505,6 +7504,7 @@ sys/man/1/vi - 664 sys sys 1196638936 2904
 sys/man/1/vnc - 664 sys sys 1196638933 4313
 sys/man/1/vt - 664 sys sys 1196638936 2424
 sys/man/1/wc - 664 sys sys 1196638936 908
+sys/man/1/weather - 664 sys sys 1198157689 640
 sys/man/1/who - 664 sys sys 1196638933 332
 sys/man/1/winwatch - 664 sys sys 1196638936 708
 sys/man/1/xd - 664 sys sys 1196638933 1517
@@ -7823,6 +7823,7 @@ sys/man/8/INDEX.html - 664 sys sys 1196638946 8619
 sys/man/8/aan - 664 sys sys 1196638946 1670
 sys/man/8/aliasmail - 664 sys sys 1196638946 1350
 sys/man/8/apm - 664 sys sys 1196638946 1811
+sys/man/8/aquarela - 664 sys sys 1198159132 3798
 sys/man/8/auth - 664 sys sys 1196638946 4996
 sys/man/8/boot - 664 sys sys 1196638946 8331
 sys/man/8/booting - 664 sys sys 1196638946 4136
@@ -8743,7 +8744,7 @@ sys/src/ape/lib/ap/plan9/9write.c - 664 sys sys 1014921986 171
 sys/src/ape/lib/ap/plan9/_buf.c - 664 sys sys 1087406385 9922
 sys/src/ape/lib/ap/plan9/_dirconv.c - 664 sys sys 1014921985 1419
 sys/src/ape/lib/ap/plan9/_envsetup.c - 664 sys sys 1048644333 2198
-sys/src/ape/lib/ap/plan9/_errno.c - 664 sys sys 1014921985 3909
+sys/src/ape/lib/ap/plan9/_errno.c - 664 sys sys 1198158066 3899
 sys/src/ape/lib/ap/plan9/_exit.c - 664 sys sys 1014921983 875
 sys/src/ape/lib/ap/plan9/_fcall.c - 664 sys sys 1014921983 6036
 sys/src/ape/lib/ap/plan9/_fdinfo.c - 664 sys sys 1038237526 2883
@@ -9491,7 +9492,7 @@ sys/src/cmd/aquarela/COPYRIGHT - 664 sys sys 1135892145 43
 sys/src/cmd/aquarela/addname.c - 664 sys sys 1135892108 1281
 sys/src/cmd/aquarela/alarm.c - 664 sys sys 1197673331 2170
 sys/src/cmd/aquarela/alloc.c - 664 sys sys 1135892108 245
-sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1136651999 7027
+sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
 sys/src/cmd/aquarela/cifscmd.c - 664 sys sys 1135892108 4430
 sys/src/cmd/aquarela/client.c - 664 sys sys 1135892108 2724
 sys/src/cmd/aquarela/dump.c - 664 sys sys 1135892108 2864
@@ -10379,7 +10380,7 @@ sys/src/cmd/fax/receiverc - 775 sys sys 944960990 581
 sys/src/cmd/fax/send.c - 664 sys sys 944960990 923
 sys/src/cmd/fax/subr.c - 664 sys sys 1015090401 1245
 sys/src/cmd/fcp.c - 664 sys sys 1136651872 3799
-sys/src/cmd/file.c - 664 sys sys 1193181267 28836
+sys/src/cmd/file.c - 664 sys sys 1198189467 28953
 sys/src/cmd/fmt.c - 664 sys sys 1137603598 4078
 sys/src/cmd/fortune.c - 664 sys sys 1072729222 1779
 sys/src/cmd/fossil - 20000000775 sys sys 1087005595 0
@@ -12456,7 +12457,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 1187047430 9714
+sys/src/cmd/ip/6in4.c - 664 sys sys 1198185057 9743
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
 sys/src/cmd/ip/dhcp.h - 664 sys sys 1184696111 3764
 sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1178482836 11969
@@ -12467,7 +12468,7 @@ sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1185922538 35209
 sys/src/cmd/ip/dhcpd/dhcpleases.c - 664 sys sys 1032655001 779
 sys/src/cmd/ip/dhcpd/mkfile - 664 sys sys 1169162185 443
 sys/src/cmd/ip/dhcpd/ndb.c - 664 sys sys 1185920230 5799
-sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1185920220 1209
+sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1198186463 1225
 sys/src/cmd/ip/dhcpd/testlook.c - 664 sys sys 950389140 4640
 sys/src/cmd/ip/dhcpd/testlookup.c - 664 sys sys 950389140 3195
 sys/src/cmd/ip/dhcpd/testping.c - 664 sys sys 950389141 352
@@ -12480,7 +12481,7 @@ sys/src/cmd/ip/ftpfs/mkfile - 664 sys sys 1048312050 173
 sys/src/cmd/ip/ftpfs/proto.c - 664 sys sys 1124935667 30337
 sys/src/cmd/ip/glob.c - 664 sys sys 1101155057 3290
 sys/src/cmd/ip/glob.h - 664 sys sys 1101155058 308
-sys/src/cmd/ip/gping.c - 664 sys sys 1169165326 19784
+sys/src/cmd/ip/gping.c - 664 sys sys 1198188401 19930
 sys/src/cmd/ip/hogports.c - 664 sys sys 1118623129 989
 sys/src/cmd/ip/httpd - 20000000775 sys sys 1083771060 0
 sys/src/cmd/ip/httpd/anonymous.c - 664 sys sys 984773807 195
@@ -12505,7 +12506,7 @@ sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1120737502 7658
 sys/src/cmd/ip/httpd/webls.denied - 664 sys sys 1064887847 3
 sys/src/cmd/ip/httpd/wikipost.c - 664 sys sys 1083771074 5913
 sys/src/cmd/ip/httpfile.c - 664 sys sys 1128556975 10037
-sys/src/cmd/ip/icmp.h - 664 sys sys 1184951372 1461
+sys/src/cmd/ip/icmp.h - 664 sys sys 1198189398 1501
 sys/src/cmd/ip/imap4d - 20000000775 sys sys 1066325859 0
 sys/src/cmd/ip/imap4d/auth.c - 664 sys sys 1015013075 3510
 sys/src/cmd/ip/imap4d/copy.c - 664 sys sys 1062298855 4597
@@ -12527,15 +12528,15 @@ sys/src/cmd/ip/imap4d/search.c - 664 sys sys 1015013077 4520
 sys/src/cmd/ip/imap4d/store.c - 664 sys sys 1066317059 1910
 sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1168894057 2587
 sys/src/cmd/ip/ipconfig - 20000000775 sys sys 1176933436 0
-sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1185922303 5738
-sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1185923430 20620
+sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1198189129 5311
+sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1198189135 20619
 sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1185923495 39912
 sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1184880750 233
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
 sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1185920805 1267
-sys/src/cmd/ip/ping.c - 664 sys sys 1186208356 10518
+sys/src/cmd/ip/ping.c - 664 sys sys 1198188930 10554
 sys/src/cmd/ip/ppp - 20000000775 sys sys 1065963823 0
 sys/src/cmd/ip/ppp/block.c - 664 sys sys 1015090266 5353
 sys/src/cmd/ip/ppp/compress.c - 664 sys sys 1072729513 11774
@@ -12606,7 +12607,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 1184887073 8733
+sys/src/cmd/ip/traceroute.c - 664 sys sys 1198186109 8747
 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

+ 16 - 15
dist/replica/plan9.db

@@ -36,7 +36,7 @@
 386/bin/ape/stty - 775 sys sys 1148500571 41080
 386/bin/ape/tar - 775 sys sys 1168402264 62184
 386/bin/ape/uname - 775 sys sys 1173754552 134895
-386/bin/aquarela - 775 sys sys 1197732624 337700
+386/bin/aquarela - 775 sys sys 1198183082 337692
 386/bin/ar - 775 sys sys 1178939751 114363
 386/bin/archfs - 775 sys sys 1179372067 146788
 386/bin/ascii - 775 sys sys 1168402265 64884
@@ -260,7 +260,7 @@
 386/bin/games/jukefs - 775 sys sys 1196742485 164538
 386/bin/games/mahjongg - 775 sys sys 1197732724 165258
 386/bin/games/memo - 775 sys sys 1197732727 156672
-386/bin/games/mp3dec - 775 sys sys 1196207154 355822
+386/bin/games/mp3dec - 775 sys sys 1198183090 388585
 386/bin/games/mp3enc - 775 sys sys 1196220182 530357
 386/bin/games/playlistfs - 775 sys sys 1196742488 148960
 386/bin/games/sokoban - 775 sys sys 1197732730 165530
@@ -6099,7 +6099,7 @@ sys/include/frame.h - 664 sys sys 1196212617 2708
 sys/include/geometry.h - 664 sys sys 1014929063 2632
 sys/include/html.h - 664 sys sys 1184472600 15622
 sys/include/httpd.h - 664 sys sys 1190835025 5800
-sys/include/ip.h - 664 sys sys 1187047442 4383
+sys/include/ip.h - 664 sys sys 1198184776 4401
 sys/include/keyboard.h - 664 sys sys 1131637696 865
 sys/include/libc.h - 664 sys sys 1168306860 19851
 sys/include/libsec.h - 664 sys sys 1188328413 8684
@@ -7354,7 +7354,6 @@ sys/man/1/INDEX.html - 664 sys sys 1196638934 16845
 sys/man/1/acid - 664 sys sys 1196638934 9730
 sys/man/1/acme - 664 sys sys 1196638934 18540
 sys/man/1/ap - 664 sys sys 1196638934 364
-sys/man/1/aquarela - 664 sys sys 1196895084 2770
 sys/man/1/ar - 664 sys sys 1196638934 3153
 sys/man/1/ascii - 664 sys sys 1196638934 2726
 sys/man/1/awk - 664 sys sys 1196638934 10881
@@ -7505,6 +7504,7 @@ sys/man/1/vi - 664 sys sys 1196638936 2904
 sys/man/1/vnc - 664 sys sys 1196638933 4313
 sys/man/1/vt - 664 sys sys 1196638936 2424
 sys/man/1/wc - 664 sys sys 1196638936 908
+sys/man/1/weather - 664 sys sys 1198157689 640
 sys/man/1/who - 664 sys sys 1196638933 332
 sys/man/1/winwatch - 664 sys sys 1196638936 708
 sys/man/1/xd - 664 sys sys 1196638933 1517
@@ -7823,6 +7823,7 @@ sys/man/8/INDEX.html - 664 sys sys 1196638946 8619
 sys/man/8/aan - 664 sys sys 1196638946 1670
 sys/man/8/aliasmail - 664 sys sys 1196638946 1350
 sys/man/8/apm - 664 sys sys 1196638946 1811
+sys/man/8/aquarela - 664 sys sys 1198159132 3798
 sys/man/8/auth - 664 sys sys 1196638946 4996
 sys/man/8/boot - 664 sys sys 1196638946 8331
 sys/man/8/booting - 664 sys sys 1196638946 4136
@@ -8743,7 +8744,7 @@ sys/src/ape/lib/ap/plan9/9write.c - 664 sys sys 1014921986 171
 sys/src/ape/lib/ap/plan9/_buf.c - 664 sys sys 1087406385 9922
 sys/src/ape/lib/ap/plan9/_dirconv.c - 664 sys sys 1014921985 1419
 sys/src/ape/lib/ap/plan9/_envsetup.c - 664 sys sys 1048644333 2198
-sys/src/ape/lib/ap/plan9/_errno.c - 664 sys sys 1014921985 3909
+sys/src/ape/lib/ap/plan9/_errno.c - 664 sys sys 1198158066 3899
 sys/src/ape/lib/ap/plan9/_exit.c - 664 sys sys 1014921983 875
 sys/src/ape/lib/ap/plan9/_fcall.c - 664 sys sys 1014921983 6036
 sys/src/ape/lib/ap/plan9/_fdinfo.c - 664 sys sys 1038237526 2883
@@ -9491,7 +9492,7 @@ sys/src/cmd/aquarela/COPYRIGHT - 664 sys sys 1135892145 43
 sys/src/cmd/aquarela/addname.c - 664 sys sys 1135892108 1281
 sys/src/cmd/aquarela/alarm.c - 664 sys sys 1197673331 2170
 sys/src/cmd/aquarela/alloc.c - 664 sys sys 1135892108 245
-sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1136651999 7027
+sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
 sys/src/cmd/aquarela/cifscmd.c - 664 sys sys 1135892108 4430
 sys/src/cmd/aquarela/client.c - 664 sys sys 1135892108 2724
 sys/src/cmd/aquarela/dump.c - 664 sys sys 1135892108 2864
@@ -10379,7 +10380,7 @@ sys/src/cmd/fax/receiverc - 775 sys sys 944960990 581
 sys/src/cmd/fax/send.c - 664 sys sys 944960990 923
 sys/src/cmd/fax/subr.c - 664 sys sys 1015090401 1245
 sys/src/cmd/fcp.c - 664 sys sys 1136651872 3799
-sys/src/cmd/file.c - 664 sys sys 1193181267 28836
+sys/src/cmd/file.c - 664 sys sys 1198189467 28953
 sys/src/cmd/fmt.c - 664 sys sys 1137603598 4078
 sys/src/cmd/fortune.c - 664 sys sys 1072729222 1779
 sys/src/cmd/fossil - 20000000775 sys sys 1087005595 0
@@ -12456,7 +12457,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 1187047430 9714
+sys/src/cmd/ip/6in4.c - 664 sys sys 1198185057 9743
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
 sys/src/cmd/ip/dhcp.h - 664 sys sys 1184696111 3764
 sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1178482836 11969
@@ -12467,7 +12468,7 @@ sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1185922538 35209
 sys/src/cmd/ip/dhcpd/dhcpleases.c - 664 sys sys 1032655001 779
 sys/src/cmd/ip/dhcpd/mkfile - 664 sys sys 1169162185 443
 sys/src/cmd/ip/dhcpd/ndb.c - 664 sys sys 1185920230 5799
-sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1185920220 1209
+sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1198186463 1225
 sys/src/cmd/ip/dhcpd/testlook.c - 664 sys sys 950389140 4640
 sys/src/cmd/ip/dhcpd/testlookup.c - 664 sys sys 950389140 3195
 sys/src/cmd/ip/dhcpd/testping.c - 664 sys sys 950389141 352
@@ -12480,7 +12481,7 @@ sys/src/cmd/ip/ftpfs/mkfile - 664 sys sys 1048312050 173
 sys/src/cmd/ip/ftpfs/proto.c - 664 sys sys 1124935667 30337
 sys/src/cmd/ip/glob.c - 664 sys sys 1101155057 3290
 sys/src/cmd/ip/glob.h - 664 sys sys 1101155058 308
-sys/src/cmd/ip/gping.c - 664 sys sys 1169165326 19784
+sys/src/cmd/ip/gping.c - 664 sys sys 1198188401 19930
 sys/src/cmd/ip/hogports.c - 664 sys sys 1118623129 989
 sys/src/cmd/ip/httpd - 20000000775 sys sys 1083771060 0
 sys/src/cmd/ip/httpd/anonymous.c - 664 sys sys 984773807 195
@@ -12505,7 +12506,7 @@ sys/src/cmd/ip/httpd/webls.c - 664 sys sys 1120737502 7658
 sys/src/cmd/ip/httpd/webls.denied - 664 sys sys 1064887847 3
 sys/src/cmd/ip/httpd/wikipost.c - 664 sys sys 1083771074 5913
 sys/src/cmd/ip/httpfile.c - 664 sys sys 1128556975 10037
-sys/src/cmd/ip/icmp.h - 664 sys sys 1184951372 1461
+sys/src/cmd/ip/icmp.h - 664 sys sys 1198189398 1501
 sys/src/cmd/ip/imap4d - 20000000775 sys sys 1066325859 0
 sys/src/cmd/ip/imap4d/auth.c - 664 sys sys 1015013075 3510
 sys/src/cmd/ip/imap4d/copy.c - 664 sys sys 1062298855 4597
@@ -12527,15 +12528,15 @@ sys/src/cmd/ip/imap4d/search.c - 664 sys sys 1015013077 4520
 sys/src/cmd/ip/imap4d/store.c - 664 sys sys 1066317059 1910
 sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1168894057 2587
 sys/src/cmd/ip/ipconfig - 20000000775 sys sys 1176933436 0
-sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1185922303 5738
-sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1185923430 20620
+sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1198189129 5311
+sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1198189135 20619
 sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1185923495 39912
 sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1184880750 233
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
 sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1185920805 1267
-sys/src/cmd/ip/ping.c - 664 sys sys 1186208356 10518
+sys/src/cmd/ip/ping.c - 664 sys sys 1198188930 10554
 sys/src/cmd/ip/ppp - 20000000775 sys sys 1065963823 0
 sys/src/cmd/ip/ppp/block.c - 664 sys sys 1015090266 5353
 sys/src/cmd/ip/ppp/compress.c - 664 sys sys 1072729513 11774
@@ -12606,7 +12607,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 1184887073 8733
+sys/src/cmd/ip/traceroute.c - 664 sys sys 1198186109 8747
 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

+ 28 - 0
dist/replica/plan9.log

@@ -18181,3 +18181,31 @@
 1197745273 1 c sys/src/9/port/qio.c - 664 sys sys 1197732972 23616
 1198011604 0 c sys/src/9/pc/ether82563.c - 664 sys sys 1198011483 34697
 1198011604 1 c sys/src/boot/pc/ether82563.c - 664 sys sys 1198011456 25413
+1198159213 0 a sys/man/8/aquarela - 664 sys sys 1198159132 3798
+1198159213 1 c sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
+1198162810 0 a sys/man/8/aquarela - 664 sys sys 1198159132 3798
+1198157410 3 c sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
+1198157410 4 d sys/man/1/aquarela - 664 sys sys 1196895084 0
+1198168206 0 a sys/man/8/aquarela - 664 sys sys 1198159132 3798
+1198171809 0 a sys/man/8/aquarela - 664 sys sys 1198159132 3798
+1198171809 1 c sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
+1198171809 2 d sys/man/1/aquarela - 664 sys sys 1196895084 0
+1198173607 0 a sys/man/8/aquarela - 664 sys sys 1198159132 3798
+1198173607 1 c sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
+1198173607 2 d sys/man/1/aquarela - 664 sys sys 1196895084 0
+1198175407 0 a sys/man/8/aquarela - 664 sys sys 1198159132 3798
+1198175407 1 c sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1198159137 7017
+1198175407 2 d sys/man/1/aquarela - 664 sys sys 1196895084 0
+1198184405 0 c 386/bin/games/mp3dec - 775 sys sys 1198183090 388585
+1198184405 1 c 386/bin/aquarela - 775 sys sys 1198183082 337692
+1198186205 0 c sys/include/ip.h - 664 sys sys 1198184776 4401
+1198186205 1 c sys/src/cmd/ip/6in4.c - 664 sys sys 1198185057 9743
+1198186205 2 c sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1198186463 1225
+1198186205 3 c sys/src/cmd/ip/icmp.h - 664 sys sys 1198186107 1613
+1198186205 4 c sys/src/cmd/ip/traceroute.c - 664 sys sys 1198186109 8747
+1198189805 0 c sys/src/cmd/ip/gping.c - 664 sys sys 1198188401 19930
+1198189805 1 c sys/src/cmd/ip/icmp.h - 664 sys sys 1198189398 1501
+1198189805 2 c sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1198189129 5311
+1198189805 3 c sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1198189135 20619
+1198189805 4 c sys/src/cmd/ip/ping.c - 664 sys sys 1198188930 10554
+1198189805 5 c sys/src/cmd/file.c - 664 sys sys 1198189467 28953

+ 1 - 0
sys/include/ip.h

@@ -125,6 +125,7 @@ struct Ip6hdr {
 	uchar	ttl;		/* hop limit */
 	uchar	src[IPaddrlen];	/* source address */
 	uchar	dst[IPaddrlen];	/* destination address */
+	uchar	payload[];
 };
 
 /*

+ 0 - 136
sys/man/1/aquarela

@@ -1,136 +0,0 @@
-.TH AQUARELA 1
-.SH NAME
-aquarela \- Microsoft\(tm Windows filesystem server
-.SH SYNOPSIS
-.B aquarela
-[
-.B -d
-.I option
-] [
-.B -n
-] [
-.B -p 
-] [
-.B -u
-.I 0|1
-] [
-.B -w
-.I name 
-]
-.SH DESCRIPTION
-.I Aquarela
-listens on port 455, 137, and optionally 129 for incoming
-Microsoft file-sharing protocol (also known as
-.SM SMB
-or
-.SM CIFS\c
-) requests for files and fulfills these from its namespace.
-.PP
-.I Aquarela's
-authentication uses the Inferno/pop secret held by the auth server.
-Transcoding is performed between spaces and non-breaking spaces to accommodate 
-fileservers other than fossil.
-Debug and log messages are appended to
-.L /sys/log/aquarela
-if it exists.
-By default the share 
-.B /
-is offered, which represents the root of the local Plan 9 filesystem.
-If a different name is requested by the client, then
-.I 9fs
-(see
-.IR srv (4))
-is invoked to attach that filesystem, which is then exported instead.
-.PP
-The options are:
-.TP
-.B -d
-.I option
-Enable one of many possible debugging options; see below 
-.TP
-.B -n
-Enable vestigial NetBios support, a NetBios listener is started
-to answer name queries, to register the the local host with the Local
-Master Browser for the chosen workgroup. 
-.I Aquarela
-can not not act as a Local Master Browser, so relies on the existence
-of an external one on the network, e.g. Samba's 
-.IR nmbd .
-This option is required to make the local machine appear in
-.I Windows
-machines
-.IR "Network Neighbourhood" ,
-however Windows machines do not need this if they map a drive directly
-to the Plan 9 systems
-.SM IP
-address.
-.TP
-.B -p
-Sends log messages to standard output, as well as to the log file.
-.TP
-.B -u
-.I 0|1
-Enable or disable Unicode support; since there is no code page support,
-the server actually sends
-.SM UTF
-if this is disabled 
-.TP
-.B -w
-.I name
-Sets the workgroup (or primary domain) to name.
-The default is
-.SM PLAN9 
-.SS "DEBUG OPTIONS"
-.TF allcmds
-.TP
-.B allcmds
-All
-.SM SMB
-requests and responses 
-.TP
-.B tids
-Connection and disconnection of clients to shares 
-.TP
-.B sids
-Creation and deletion of search ids 
-.TP
-.B fids
-Creation and deletion of file ids 
-.TP
-.B rap2
-RAP calls 
-.TP
-.B find 
-Trans2 find commands 
-.TP
-.B query
-Trans2 query commands 
-.TP
-.B sharedfiles
-All files opened 
-.TP
-.B poolparanoia 
-Draconian error checking in memory allocator 
-.TP
-.B sessions
-Connections and disconnections to the server 
-.TP
-.B rep
-Regular expression conversions 
-.TP
-.B locks
-Locking activity 
-.TP
-.B any-smb-name
-If the debug option matches the symbolic name of a 
-.SM SMB
-request or transaction2 sub-request 
-(e.g.
-.SM SMB_COM_SESSION_SETUP_ANDX
-or
-.SM SMB_TRANS2_FIND_FIRST2\c
-) logging is enabled for just that message type. 
-.TP
-.B 0xnn
-A 2 digit hex constant enables debugging of the message with this
-numeric id.

+ 35 - 0
sys/man/1/weather

@@ -0,0 +1,35 @@
+.TH WEATHER 1
+.SH NAME
+weather \- print weather report
+.SH SYNOPSIS
+.B weather
+[
+.I air
+]  [
+.I st
+]
+.SH DESCRIPTION
+.I Weather
+prints the local conditions and seven-day forecast most recently reported at the
+.SM US
+airport with the three-letter location identifier
+.IR air .
+Given a two-letter
+.SM US
+state abbreviation
+.I st
+instead,
+.I weather
+prints a table of
+.I air
+location identifiers known for
+.IR st .
+.PP
+The arguments are mutually exclusive and case-insensitive.
+If neither is given,
+.I air
+defaults to location identifier
+.BR ewr ,
+designating the Newark, NJ, airport near Bell Labs, Murray Hill.
+.SH SOURCE
+.B /rc/bin/weather

+ 226 - 0
sys/man/8/aquarela

@@ -0,0 +1,226 @@
+.TH AQUARELA 8
+.SH NAME
+aquarela \- CIFS server
+.SH SYNOPSIS
+.B aquarela
+[
+.B -np
+]
+[
+.B -d
+.I debug
+]
+[
+.B -u
+.I N
+]
+[
+.B -w
+.I workgroup 
+]
+.SH DESCRIPTION
+.I Aquarela
+provides
+.SM CIFS
+(once known as
+.SM SMB\c
+)
+access to Plan 9 file servers.
+It announces and subsequently listens on
+.B tcp!*!445
+for connections to the individual file hierarchies called ``shares'' by
+.SM CIFS\c .
+Users are authenticated with their Inferno/\c
+.SM POP
+password.
+Each session is managed by a process running as the authenticated user.
+Two persistent processes handle listening, session setup, and housekeeping.
+.PP
+An
+.I aquarela
+.SM CIFS
+share corresponds to a directory under
+.BR /n .
+A client request for a specific share, say,
+.BR share ,
+causes
+.I aquarela
+to serve
+.B /n/share.
+If that path is not already a mountpoint, a
+.IR 9fs (4)
+connection to the file server
+.B share
+is attempted.
+If connection succeeds, a file hierarchy rooted at
+.B /n/share
+is finally presented to the client.
+The client request fails otherwise.
+Requests for the protocol equivalent of
+.B /
+are satisfied with a one-level directory containing only the default share,
+.BR local.
+.PP
+The options are:
+.TP
+.BI -u " N
+Send Unicode.
+For
+.IR N ,
+.B 1
+enables,
+.B 0
+disables Unicoding of file names and metadata.
+There is no code page support, so
+.I aquarela
+emits
+.SM UTF
+if
+.I N
+is
+.BR 0 .
+.TP
+.BI -w " workgroup
+Set
+.I workgroup
+(or ``primary domain'') of server.
+Default
+.BR PLAN9 .
+.TP
+.B -n
+Enable limited
+.SM NETBIOS
+service.
+.I Aquarela
+will register with the ``master browser'' for
+.I workgroup
+and listen on
+.B tcp!*!139
+for name resolution queries.
+This works only in tandem with a complete
+.SM NETBIOS
+master name server, like that provided by
+.SM UNIX
+.IR nmbd (8).
+.SM NETBIOS
+is not required for
+.SM CIFS
+file service.
+.PD
+.SH EXAMPLE
+To start a
+.SM CIFS
+server on system
+.B plan9
+as a member of
+.BR WORKGROUP :
+.IP
+.EX
+aquarela -u 1 -w WORKGROUP &
+.EE
+.PP
+To make 
+.BR plan9 's 
+.B dump
+filesystem available as drive
+.B Y:
+on a Windows machine:
+.IP
+.EX
+net use Y: \\\\plan9.example.com\\dump
+.EE
+.SH FILES
+.TP
+.B /n/local
+Default
+.SM CIFS
+share
+.TP
+.B /sys/log/aquarela
+Log file, if it exists
+.PD
+.SH SOURCE
+.B /sys/src/cmd/aquarela
+.SH SEE ALSO
+.IR 9fs (4),
+.IR UTF (6)
+.SH DIAGNOSTICS
+Log messages are appended to
+.B /sys/log/aquarela
+if it exists. The
+.B -p
+option prints them on standard output as well.
+The
+.B -d
+option adds verbose output about
+.I debug
+to the log messages, where
+.I debug
+is one of:
+.TF any-smb-name
+.TP
+.B allcmds
+All
+.SM CIFS
+requests and responses.
+.TP
+.B tids
+Connections and disconnections per-share.
+.TP
+.B sids
+Creation and deletion of search ids.
+.TP
+.B fids
+Creation and deletion of file ids.
+.TP
+.B rap2
+.SM RAP
+calls.
+.TP
+.B find 
+Transaction2 find commands.
+.TP
+.B query
+Transaction2 query commands.
+.TP
+.B sharedfiles
+All files opened.
+.TP
+.B poolparanoia 
+Draconian error checking in memory allocator.
+.TP
+.B sessions
+Connections and disconnections on server.
+.TP
+.B rep
+Regular expression conversions.
+.TP
+.B locks
+Locking activity.
+.TP
+.I any-smb-name
+Debug only
+.B SMB_
+requests or
+.B transaction2
+sub-requests
+(e.g.,
+.B SMB_COM_SESSION_SETUP_ANDX
+or
+.BR SMB_TRANS2_FIND_FIRST2 )
+matching symbolic name
+.I any-smb-name. 
+.TP
+.BI 0x nn
+Debug only messages with this hexadecimal id.
+.PD
+.SH BUGS
+The first login attempt from a given Windows login session often fails erroneously - try again.
+The server disk space reported by some clients is inaccurate.
+Some clients can't rename directories.
+Write attempts without sufficient permissions fail (correctly), but appear on client to temporarily succeed.
+.PP
+The multitude of diagnostics both in the program and in this manual page reflect the in-progress nature of the code.
+.PP
+This program should probably be named
+.IR cifsserver .

+ 1 - 1
sys/src/ape/lib/ap/plan9/_errno.c

@@ -81,7 +81,7 @@ static struct errmap {
 	{EIO,		"phase error -- cannot happen"},
 	{EEXIST,	"create -- file exists"},
 	{EINVAL,	"create -- . and .. illegal names"},
-	{ENOTEMPTY,	"remove -- directory not empty"},
+	{ENOTEMPTY,	"directory not empty"},
 	{EINVAL,	"attach -- privileged user"},
 	{EPERM,		"wstat -- not owner"},
 	{EPERM,		"wstat -- not in group"},

+ 1 - 1
sys/src/cmd/aquarela/aquarela.c

@@ -176,7 +176,7 @@ cifsaccept(SmbCifsSession *s, SMBCIFSWRITEFN **writep)
 void
 usage(void)
 {
-	fprint(2, "usage: %s [-d debug-opt] [-n] [-p] [-u 1|0] [-w workgroup]\n", argv0);
+	fprint(2, "usage: %s [-np] [-d debug] [-u N] [-w workgroup]\n", argv0);
 	threadexitsall("usage");
 }
 

+ 10 - 6
sys/src/cmd/file.c

@@ -803,23 +803,27 @@ struct	FILE_STRING
 	".tr",			"troff input",		3,	"text/troff",
 	"vac:",			"venti score",		4,	"text/plain",
 	"-----BEGIN CERTIFICATE-----\n",
-				"pem certificate",	3,	"text/plain",
+				"pem certificate",	-1,	"text/plain",
 	"-----BEGIN TRUSTED CERTIFICATE-----\n",
-				"pem trusted certificate", 3,	"text/plain",
+				"pem trusted certificate", -1,	"text/plain",
 	"-----BEGIN X509 CERTIFICATE-----\n",
-				"pem x.509 certificate", 3,	"text/plain",
-	"subject=/C=",		"pem certificate with header", 3, "text/plain",
+				"pem x.509 certificate", -1,	"text/plain",
+	"subject=/C=",		"pem certificate with header", -1, "text/plain",
+	"process snapshot ",	"process snapshot",	-1,	"application/snapfs",
 	0,0,0,0
 };
 
 int
 istring(void)
 {
-	int i;
+	int i, l;
 	struct FILE_STRING *p;
 
 	for(p = file_string; p->key; p++) {
-		if(nbuf >= p->length && !memcmp(buf, p->key, p->length)) {
+		l = p->length;
+		if(l == -1)
+			l = strlen(p->key);
+		if(nbuf >= l && memcmp(buf, p->key, l) == 0) {
 			if(mime)
 				print("%s\n", p->mime);
 			else

+ 3 - 2
sys/src/cmd/ip/6in4.c

@@ -25,9 +25,10 @@ struct Iphdr
 	uchar	cksum[2];	/* Header checksum */
 	uchar	src[4];		/* Ip source (uchar ordering unimportant) */
 	uchar	dst[4];		/* Ip destination (uchar ordering unimportant) */
+	uchar	payload[];
 };
 
-#define STFHDR sizeof(Iphdr)
+#define STFHDR offsetof(Iphdr, payload[0])
 
 int anysender;
 int gateway;
@@ -310,7 +311,7 @@ ip2tunnel(int in, int out)
 			continue;
 
 		/* check length: drop if too short, trim if too long */
-		m = nhgets(ip->ploadlen) + sizeof(Ip6hdr);
+		m = nhgets(ip->ploadlen) + IPV6HDR_LEN;
 		if (m > n)
 			continue;
 		if (m < n)

+ 8 - 12
sys/src/cmd/ip/dhcpd/ping.c

@@ -22,12 +22,10 @@ catch(void *a, char *msg)
 int
 icmpecho(uchar *a)
 {
-	int fd;
-	char buf[512];
-	Icmp *ip;
-	int i, n, len;
+	int fd, i, n, len, rv;
 	ushort sseq, x;
-	int rv;
+	char buf[512];
+	Icmphdr *ip;
 
 	rv = 0;
 	if (!isv4(a))
@@ -40,7 +38,7 @@ icmpecho(uchar *a)
 
 	sseq = getpid()*time(0);
 
-	ip = (Icmp*)buf;
+	ip = (Icmphdr *)(buf + IPV4HDR_LEN);
 	notify(catch);
 	for(i = 0; i < 3; i++){
 		ip->type = EchoRequest;
@@ -48,7 +46,7 @@ icmpecho(uchar *a)
 		strcpy((char*)ip->data, MSG);
 		ip->seq[0] = sseq;
 		ip->seq[1] = sseq>>8;
-		len = IPV4HDR_LEN+ICMP_HDRSIZE+sizeof(MSG);
+		len = IPV4HDR_LEN + ICMP_HDRSIZE + sizeof(MSG);
 
 		/* send a request */
 		if(write(fd, buf, len) < len)
@@ -62,11 +60,9 @@ icmpecho(uchar *a)
 			continue;
 
 		/* an answer to our echo request? */
-		x = (ip->seq[1]<<8)|ip->seq[0];
-		if(n >= len)
-		if(ip->type == EchoReply)
-		if(x == sseq)
-		if(strcmp((char*)ip->data, MSG) == 0){
+		x = (ip->seq[1]<<8) | ip->seq[0];
+		if(n >= len && ip->type == EchoReply && x == sseq &&
+		    strcmp((char*)ip->data, MSG) == 0){
 			rv = 1;
 			break;
 		}

+ 16 - 13
sys/src/cmd/ip/gping.c

@@ -47,7 +47,7 @@ struct Req
 {
 	int	seq;	/* sequence number */
 	vlong	time;	/* time sent */
-	int	rtt;
+//	int	rtt;
 	Req	*next;
 };
 
@@ -477,22 +477,22 @@ pingclean(Machine *m, ushort seq, vlong now, int)
 	}
 }
 
+/* IPv4 only */
 void
 pingsend(Machine *m)
 {
-	char buf[128];
-	Icmp *ip;
 	int i;
+	char buf[128], err[ERRMAX];
+	Icmphdr *ip;
 	Req *r;
-	char err[ERRMAX];
-
-	ip = (Icmp*)buf;
 
+	ip = (Icmphdr *)(buf + IPV4HDR_LEN);
+	memset(buf, 0, sizeof buf);
 	r = malloc(sizeof *r);
 	if(r == nil)
 		return;
 
-	for(i = 32; i < 64; i++)
+	for(i = 32; i < MSGLEN; i++)
 		buf[i] = i;
 	ip->type = EchoRequest;
 	ip->code = 0;
@@ -509,7 +509,7 @@ pingsend(Machine *m)
 	m->last = r;
 	r->time = nsec();
 	unlock(m);
-	if(write(m->pingfd, ip, MSGLEN) < MSGLEN){
+	if(write(m->pingfd, buf, MSGLEN) < MSGLEN){
 		errstr(err, sizeof err);
 		if(strstr(err, "unreach")||strstr(err, "exceed"))
 			m->unreachable++;
@@ -517,17 +517,20 @@ pingsend(Machine *m)
 	m->seq++;
 }
 
+/* IPv4 only */
 void
 pingrcv(void *arg)
 {
+	int i, n, fd;
 	uchar buf[512];
-	Icmp *ip;
 	ushort x;
-	int i, n, fd;
 	vlong now;
+	Icmphdr *ip;
+	Ip4hdr *ip4;
 	Machine *m = arg;
 
-	ip = (Icmp*)buf;
+	ip4 = (Ip4hdr *)buf;
+	ip = (Icmphdr *)(buf + IPV4HDR_LEN);
 	fd = dup(m->pingfd, -1);
 	for(;;){
 		n = read(fd, buf, sizeof(buf));
@@ -541,11 +544,11 @@ pingrcv(void *arg)
 		for(i = 32; i < MSGLEN; i++)
 			if(buf[i] != (i&0xff))
 				continue;
-		x = (ip->seq[1]<<8)|ip->seq[0];
+		x = (ip->seq[1]<<8) | ip->seq[0];
 		if(ip->type != EchoReply || ip->code != 0)
 			continue;
 		lock(m);
-		pingclean(m, x, now, ip->ttl);
+		pingclean(m, x, now, ip4->ttl);
 		unlock(m);
 	}
 }

+ 16 - 19
sys/src/cmd/ip/icmp.h

@@ -41,19 +41,8 @@ enum
 	ICMP_HDRSIZE	= 8,
 };
 
-/* the icmp payload has the same format in v4 and v6 */
-typedef struct Icmphdr Icmphdr;
-struct Icmphdr {
-	uchar	type;
-	uchar	code;
-	uchar	cksum[2];
-	uchar	icmpid[2];
-	uchar	seq[2];
-	uchar	data[1];
-};
-
-typedef struct Icmp Icmp;
-struct Icmp
+typedef struct Ip4hdr Ip4hdr;
+struct Ip4hdr
 {
 	uchar	vihl;		/* Version and header length */
 	uchar	tos;		/* Type of service */
@@ -66,12 +55,20 @@ struct Icmp
 	uchar	src[4];		/* Ipv4 source */
 	uchar	dst[4];		/* Ipv4 destination */
 
-	Icmphdr;
+	uchar	data[];
 };
 
-typedef struct Icmp6 Icmp6;
-struct Icmp6
-{
-	Ip6hdr;
-	Icmphdr;
+// #define IP4HDRSZ offsetof(Ip4hdr, data[0])
+
+/* the icmp payload has the same format in v4 and v6 */
+typedef struct Icmphdr Icmphdr;
+struct Icmphdr {
+	uchar	type;
+	uchar	code;
+	uchar	cksum[2];
+	uchar	icmpid[2];
+	uchar	seq[2];
+	uchar	data[];
 };
+
+// #define ICMPHDRSZ offsetof(Icmphdr, data[0])

+ 0 - 15
sys/src/cmd/ip/ipconfig/ipconfig.h

@@ -195,8 +195,6 @@ enum {
 
 enum {
 	MAXTTL		= 255,
-	IP4_VER		= 0x40,
-	IP6_VER		= 0x60,
 	D64HLEN		= IPV6HDR_LEN - IPV4HDR_LEN,
 	IP_MAX		= 32*1024,
 };
@@ -206,19 +204,6 @@ struct Headers {
 	uchar	src[IPaddrlen];
 };
 
-struct Ip4hdr{
-	uchar	vihl;		/* Version and header length */
-	uchar	tos;		/* Type of service */
-	uchar	length[2];	/* packet length */
-	uchar	id[2];		/* ip->identification */
-	uchar	frag[2];	/* Fragment information */
-	uchar	ttl;		/* Time to live */
-	uchar	proto;		/* Protocol */
-	uchar	cksum[2];	/* Header checksum */
-	uchar	src[4];		/* IP source */
-	uchar	dst[4];		/* IP destination */
-};
-
 struct Routersol {
 	uchar	vcf[4];		/* version:4, traffic class:8, flow label:20 */
 	uchar	ploadlen[2];	/* payload length: packet length - 40 */

+ 1 - 1
sys/src/cmd/ip/ipconfig/ipv6.c

@@ -29,7 +29,7 @@ struct Hdr			/* ICMP v4 & v6 header */
 	uchar	type;
 	uchar	code;
 	uchar	cksum[2];	/* Checksum */
-	uchar	data[1];
+	uchar	data[];
 };
 
 char *icmpmsg6[Maxtype6+1] =

+ 12 - 9
sys/src/cmd/ip/ping.c

@@ -85,7 +85,7 @@ catch(void *a, char *msg)
 static void
 prlost4(ushort seq, void *v)
 {
-	Icmp *ip4 = v;
+	Ip4hdr *ip4 = v;
 
 	print("lost %ud: %V -> %V\n", seq, ip4->src, ip4->dst);
 }
@@ -93,7 +93,7 @@ prlost4(ushort seq, void *v)
 static void
 prlost6(ushort seq, void *v)
 {
-	Icmp6 *ip6 = v;
+	Ip6hdr *ip6 = v;
 
 	print("lost %ud: %I -> %I\n", seq, ip6->src, ip6->dst);
 }
@@ -101,7 +101,7 @@ prlost6(ushort seq, void *v)
 static void
 prreply4(Req *r, void *v)
 {
-	Icmp *ip4 = v;
+	Ip4hdr *ip4 = v;
 
 	print("%ud: %V -> %V rtt %lld µs, avg rtt %lld µs, ttl = %d\n",
 		r->seq - firstseq, ip4->src, ip4->dst, r->rtt, sum/rcvdmsgs,
@@ -111,7 +111,7 @@ prreply4(Req *r, void *v)
 static void
 prreply6(Req *r, void *v)
 {
-	Icmp6 *ip6 = v;
+	Ip6hdr *ip6 = v;
 
 	print("%ud: %I -> %I rtt %lld µs, avg rtt %lld µs, ttl = %d\n",
 		r->seq - firstseq, ip6->src, ip6->dst, r->rtt, sum/rcvdmsgs,
@@ -139,8 +139,7 @@ geticmp(void *v)
 {
 	char *p = v;
 
-	p += proto->iphdrsz;
-	return (Icmphdr *)p;
+	return (Icmphdr *)(p + proto->iphdrsz);
 }
 
 void
@@ -150,8 +149,12 @@ clean(ushort seq, vlong now, void *v)
 	Req **l, *r;
 
 	ttl = 0;
-	if (v)
-		ttl = proto->version == 4? ((Icmp *)v)->ttl: ((Icmp6 *)v)->ttl;
+	if (v) {
+		if (proto->version == 4)
+			ttl = ((Ip4hdr *)v)->ttl;
+		else
+			ttl = ((Ip6hdr *)v)->ttl;
+	}
 	lock(&listlock);
 	last = nil;
 	for(l = &first; *l; ){
@@ -253,7 +256,7 @@ sender(int fd, int msglen, int interval, int n)
 	myipvnaddr(me, proto, network);
 	if (proto->version == 4) {
 		v6tov4(mev4, me);
-		memmove(((Icmp *)buf)->src, mev4, IPv4addrlen);
+		memmove(((Ip4hdr *)buf)->src, mev4, IPv4addrlen);
 	} else
 		ipmove(((Ip6hdr *)buf)->src, me);
 	if (addresses)

+ 7 - 11
sys/src/cmd/ip/traceroute.c

@@ -185,10 +185,8 @@ static int
 icmpprobe(int cfd, int dfd, char *dest, int interval)
 {
 	int x, i, n, len, rv;
-	char buf[512];
-	Icmp *ip;
-	char msg[Maxstring];
-	char err[Maxstring];
+	char buf[512], err[Maxstring], msg[Maxstring];
+	Icmphdr *ip;
 
 	seek(cfd, 0, 0);
 	n = snprint(msg, sizeof msg, "connect %s", dest);
@@ -196,7 +194,7 @@ icmpprobe(int cfd, int dfd, char *dest, int interval)
 		return -1;
 
 	rv = -1;
-	ip = (Icmp*)buf;
+	ip = (Icmphdr *)(buf + IPV4HDR_LEN);
 	for(i = 0; i < 3; i++){
 		alarm(interval/3);
 		ip->type = EchoRequest;
@@ -204,7 +202,7 @@ icmpprobe(int cfd, int dfd, char *dest, int interval)
 		strcpy((char*)ip->data, MSG);
 		ip->seq[0] = MAGIC;
 		ip->seq[1] = MAGIC>>8;
-		len = IPV4HDR_LEN+ICMP_HDRSIZE+sizeof(MSG);
+		len = IPV4HDR_LEN + ICMP_HDRSIZE + sizeof(MSG);
 
 		/* send a request */
 		if(write(dfd, buf, len) < len)
@@ -222,11 +220,9 @@ icmpprobe(int cfd, int dfd, char *dest, int interval)
 			werrstr(err);
 			continue;
 		}
-		x = (ip->seq[1]<<8)|ip->seq[0];
-		if(n >= len)
-		if(ip->type == EchoReply)
-		if(x == MAGIC)
-		if(strcmp((char*)ip->data, MSG) == 0){
+		x = (ip->seq[1]<<8) | ip->seq[0];
+		if(n >= len && ip->type == EchoReply && x == MAGIC &&
+		    strcmp((char*)ip->data, MSG) == 0){
 			rv = 0;
 			break;
 		}