Browse Source

Plan 9 from Bell Labs 2007-08-14

David du Colombier 13 years ago
parent
commit
a7be1686d0

+ 24 - 20
dist/replica/_plan9.db

@@ -6080,7 +6080,7 @@ sys/include/frame.h - 664 sys sys 1147706379 2682
 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 1177187803 5794
-sys/include/ip.h - 664 sys sys 1185389848 4324
+sys/include/ip.h - 664 sys sys 1187047442 4383
 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 1181273373 8263
@@ -7645,9 +7645,9 @@ sys/man/3/dup - 664 sys sys 1015024778 1099
 sys/man/3/env - 664 sys sys 1015024778 1409
 sys/man/3/ether - 664 sys sys 1178597986 2890
 sys/man/3/floppy - 664 sys sys 954378905 881
-sys/man/3/fs - 664 sys sys 1175145095 3147
+sys/man/3/fs - 664 sys sys 1186946771 3159
 sys/man/3/i82365 - 664 sys sys 954378906 884
-sys/man/3/ip - 664 sys sys 1186348061 26244
+sys/man/3/ip - 664 sys sys 1187046244 26227
 sys/man/3/kbmap - 664 sys sys 1131110122 1732
 sys/man/3/kprof - 664 sys sys 1018029972 1377
 sys/man/3/loopback - 664 sys sys 964662153 1995
@@ -7660,7 +7660,7 @@ sys/man/3/proc - 664 sys sys 1138458595 12062
 sys/man/3/root - 664 sys sys 1046958450 632
 sys/man/3/rtc - 664 sys sys 954378857 667
 sys/man/3/sd - 664 sys sys 1176502187 5678
-sys/man/3/sdaoe - 664 sys sys 1186723542 1310
+sys/man/3/sdaoe - 664 sys sys 1186965881 1320
 sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
@@ -7683,7 +7683,7 @@ sys/man/4/execnet - 664 sys sys 1019866708 1069
 sys/man/4/exportfs - 664 sys sys 1145881912 4655
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1185680600 14842
-sys/man/4/fossil - 664 sys sys 1165622806 9590
+sys/man/4/fossil - 664 sys sys 1186820346 9592
 sys/man/4/fs - 664 sys sys 1019058716 3387
 sys/man/4/ftpfs - 664 sys sys 1112563349 4410
 sys/man/4/httpfile - 664 sys sys 1128556957 1233
@@ -7817,7 +7817,7 @@ sys/man/8/pem - 664 sys sys 1060263669 1189
 sys/man/8/ping - 664 sys sys 1169105315 3650
 sys/man/8/plan9.ini - 664 sys sys 1181239022 23242
 sys/man/8/pop3 - 664 sys sys 1063854676 2720
-sys/man/8/ppp - 664 sys sys 1125530075 4414
+sys/man/8/ppp - 664 sys sys 1187046045 4430
 sys/man/8/prep - 664 sys sys 1152729153 14013
 sys/man/8/qer - 664 sys sys 1067723129 4909
 sys/man/8/reboot - 664 sys sys 1162423006 443
@@ -7965,22 +7965,22 @@ sys/src/9/ip/arp.c - 664 sys sys 1184794688 11234
 sys/src/9/ip/chandial.c - 664 sys sys 1099020048 2295
 sys/src/9/ip/devip.c - 664 sys sys 1161061185 24242
 sys/src/9/ip/eipconvtest.c - 664 sys sys 1022588098 3135
-sys/src/9/ip/esp.c - 664 sys sys 1186010386 17349
+sys/src/9/ip/esp.c - 664 sys sys 1187037502 17754
 sys/src/9/ip/ethermedium.c - 664 sys sys 1184244252 15419
-sys/src/9/ip/gre.c - 664 sys sys 1184946959 5071
+sys/src/9/ip/gre.c - 664 sys sys 1187045851 5103
 sys/src/9/ip/icmp.c - 664 sys sys 1184946959 9498
-sys/src/9/ip/icmp6.c - 664 sys sys 1184794725 18137
+sys/src/9/ip/icmp6.c - 664 sys sys 1187036525 18131
 sys/src/9/ip/igmp.c - 664 sys sys 1055700768 5175
 sys/src/9/ip/il.c - 664 sys sys 1184946959 27225
 sys/src/9/ip/inferno.c - 664 sys sys 1022588098 517
-sys/src/9/ip/ip.c - 664 sys sys 1176957040 15288
-sys/src/9/ip/ip.h - 664 sys sys 1184794803 15981
+sys/src/9/ip/ip.c - 664 sys sys 1187037311 14785
+sys/src/9/ip/ip.h - 664 sys sys 1187037311 16477
 sys/src/9/ip/ipaux.c - 664 sys sys 1185486678 12341
 sys/src/9/ip/ipifc.c - 664 sys sys 1184794851 34006
-sys/src/9/ip/ipmux.c - 664 sys sys 1179708314 15363
+sys/src/9/ip/ipmux.c - 664 sys sys 1187047550 14991
 sys/src/9/ip/iproute.c - 664 sys sys 1168305878 14778
-sys/src/9/ip/ipv6.c - 664 sys sys 1184794860 14514
-sys/src/9/ip/ipv6.h - 664 sys sys 1185486283 4322
+sys/src/9/ip/ipv6.c - 664 sys sys 1187036522 14427
+sys/src/9/ip/ipv6.h - 664 sys sys 1187036522 4321
 sys/src/9/ip/loopbackmedium.c - 664 sys sys 1055701769 1671
 sys/src/9/ip/netdevmedium.c - 664 sys sys 1045063517 2675
 sys/src/9/ip/netlog.c - 664 sys sys 1184794933 4004
@@ -8161,14 +8161,14 @@ sys/src/9/port - 20000000775 sys sys 1161222882 0
 sys/src/9/port/alarm.c - 664 sys sys 1134042902 1425
 sys/src/9/port/alloc.c - 664 sys sys 1138459977 5704
 sys/src/9/port/allocb.c - 664 sys sys 1123676437 3340
-sys/src/9/port/aoe.h - 664 sys sys 1186714271 805
+sys/src/9/port/aoe.h - 664 sys sys 1187043215 806
 sys/src/9/port/auth.c - 664 sys sys 1123647282 2392
 sys/src/9/port/cache.c - 664 sys sys 1170456667 9285
 sys/src/9/port/chan.c - 664 sys sys 1146151714 34773
 sys/src/9/port/cis.c - 664 sys sys 1099761153 9248
 sys/src/9/port/debugalloc.c - 664 sys sys 1014931171 10402
 sys/src/9/port/dev.c - 664 sys sys 1146151714 8177
-sys/src/9/port/devaoe.c - 664 sys sys 1186772629 41313
+sys/src/9/port/devaoe.c - 664 sys sys 1187034234 41526
 sys/src/9/port/devaudio.c - 664 sys sys 1170456648 21199
 sys/src/9/port/devbridge.c - 664 sys sys 1185994684 24171
 sys/src/9/port/devcap.c - 664 sys sys 1178886040 4141
@@ -8187,7 +8187,7 @@ sys/src/9/port/devpipe.c - 664 sys sys 1077055016 5825
 sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
 sys/src/9/port/devproc.c - 664 sys sys 1168304324 28543
 sys/src/9/port/devroot.c - 664 sys sys 1146151714 4242
-sys/src/9/port/devsd.c - 664 sys sys 1186618574 31315
+sys/src/9/port/devsd.c - 664 sys sys 1186965855 31275
 sys/src/9/port/devsdp.c - 664 sys sys 1057323393 44800
 sys/src/9/port/devsegment.c - 664 sys sys 1131289891 9610
 sys/src/9/port/devsrv.c - 664 sys sys 1165810571 5711
@@ -8235,7 +8235,7 @@ sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
 sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
 sys/src/9/port/sd.h - 664 sys sys 1186618553 2499
-sys/src/9/port/sdaoe.c - 664 sys sys 1186772635 9983
+sys/src/9/port/sdaoe.c - 664 sys sys 1187034227 9934
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
 sys/src/9/port/semaphore.p - 664 sys sys 1143129797 2424
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
@@ -12473,7 +12473,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 1186210033 8811
+sys/src/cmd/ip/6in4.c - 664 sys sys 1187047430 9714
 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
@@ -15852,4 +15852,8 @@ 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
-sys/man/4/fossil - 664 sys sys 1186820346 9592
+386/bin/ip/6in4 - 775 sys sys 1187061208 91687
+386/lib/libip.a - 664 sys sys 1187061208 34710
+386/lib/libndb.a - 664 sys sys 1187061208 64470
+386/lib/libsunrpc.a - 664 sys sys 1187061209 353148
+sys/src/9/port/devaoe.c - 664 sys sys 1187061517 41444

+ 22 - 22
dist/replica/plan9.db

@@ -285,7 +285,7 @@
 386/bin/import - 775 sys sys 1179777651 102499
 386/bin/iostats - 775 sys sys 1178568280 98906
 386/bin/ip - 20000000775 sys sys 1016920851 0
-386/bin/ip/6in4 - 775 sys sys 1186257752 90935
+386/bin/ip/6in4 - 775 sys sys 1187061208 91687
 386/bin/ip/dhcpclient - 775 sys sys 1178568281 92992
 386/bin/ip/dhcpd - 775 sys sys 1186112227 151324
 386/bin/ip/dhcpleases - 775 sys sys 1186112228 85106
@@ -562,19 +562,19 @@
 386/lib/libgeometry.a - 664 sys sys 1168402366 50470
 386/lib/libhtml.a - 664 sys sys 1186370975 229202
 386/lib/libhttpd.a - 664 sys sys 1181332906 99734
-386/lib/libip.a - 664 sys sys 1185420496 34710
+386/lib/libip.a - 664 sys sys 1187061208 34710
 386/lib/libl.a - 664 sys sys 1168402367 5372
 386/lib/libmach.a - 664 sys sys 1184380786 807390
 386/lib/libmemdraw.a - 664 sys sys 1168402369 284092
 386/lib/libmemlayer.a - 664 sys sys 1168402369 47360
 386/lib/libmp.a - 664 sys sys 1181332906 79978
-386/lib/libndb.a - 664 sys sys 1185420497 64470
+386/lib/libndb.a - 664 sys sys 1187061208 64470
 386/lib/libplumb.a - 664 sys sys 1168402370 19408
 386/lib/libregexp.a - 664 sys sys 1181507273 37290
 386/lib/libscribble.a - 664 sys sys 1175972562 107238
 386/lib/libsec.a - 664 sys sys 1181332908 646724
 386/lib/libstdio.a - 664 sys sys 1176432133 126062
-386/lib/libsunrpc.a - 664 sys sys 1185420498 353148
+386/lib/libsunrpc.a - 664 sys sys 1187061209 353148
 386/lib/libthread.a - 664 sys sys 1184731247 71918
 386/lib/libventi.a - 664 sys sys 1181332909 97858
 386/mbr - 775 sys sys 1131317338 407
@@ -6080,7 +6080,7 @@ sys/include/frame.h - 664 sys sys 1147706379 2682
 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 1177187803 5794
-sys/include/ip.h - 664 sys sys 1185389848 4324
+sys/include/ip.h - 664 sys sys 1187047442 4383
 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 1181273373 8263
@@ -7645,9 +7645,9 @@ sys/man/3/dup - 664 sys sys 1015024778 1099
 sys/man/3/env - 664 sys sys 1015024778 1409
 sys/man/3/ether - 664 sys sys 1178597986 2890
 sys/man/3/floppy - 664 sys sys 954378905 881
-sys/man/3/fs - 664 sys sys 1175145095 3147
+sys/man/3/fs - 664 sys sys 1186946771 3159
 sys/man/3/i82365 - 664 sys sys 954378906 884
-sys/man/3/ip - 664 sys sys 1186348061 26244
+sys/man/3/ip - 664 sys sys 1187046244 26227
 sys/man/3/kbmap - 664 sys sys 1131110122 1732
 sys/man/3/kprof - 664 sys sys 1018029972 1377
 sys/man/3/loopback - 664 sys sys 964662153 1995
@@ -7660,7 +7660,7 @@ sys/man/3/proc - 664 sys sys 1138458595 12062
 sys/man/3/root - 664 sys sys 1046958450 632
 sys/man/3/rtc - 664 sys sys 954378857 667
 sys/man/3/sd - 664 sys sys 1176502187 5678
-sys/man/3/sdaoe - 664 sys sys 1186723542 1310
+sys/man/3/sdaoe - 664 sys sys 1186965881 1320
 sys/man/3/segment - 664 sys sys 1017423721 2378
 sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
@@ -7817,7 +7817,7 @@ sys/man/8/pem - 664 sys sys 1060263669 1189
 sys/man/8/ping - 664 sys sys 1169105315 3650
 sys/man/8/plan9.ini - 664 sys sys 1181239022 23242
 sys/man/8/pop3 - 664 sys sys 1063854676 2720
-sys/man/8/ppp - 664 sys sys 1125530075 4414
+sys/man/8/ppp - 664 sys sys 1187046045 4430
 sys/man/8/prep - 664 sys sys 1152729153 14013
 sys/man/8/qer - 664 sys sys 1067723129 4909
 sys/man/8/reboot - 664 sys sys 1162423006 443
@@ -7965,22 +7965,22 @@ sys/src/9/ip/arp.c - 664 sys sys 1184794688 11234
 sys/src/9/ip/chandial.c - 664 sys sys 1099020048 2295
 sys/src/9/ip/devip.c - 664 sys sys 1161061185 24242
 sys/src/9/ip/eipconvtest.c - 664 sys sys 1022588098 3135
-sys/src/9/ip/esp.c - 664 sys sys 1186010386 17349
+sys/src/9/ip/esp.c - 664 sys sys 1187037502 17754
 sys/src/9/ip/ethermedium.c - 664 sys sys 1184244252 15419
-sys/src/9/ip/gre.c - 664 sys sys 1184946959 5071
+sys/src/9/ip/gre.c - 664 sys sys 1187045851 5103
 sys/src/9/ip/icmp.c - 664 sys sys 1184946959 9498
-sys/src/9/ip/icmp6.c - 664 sys sys 1184794725 18137
+sys/src/9/ip/icmp6.c - 664 sys sys 1187036525 18131
 sys/src/9/ip/igmp.c - 664 sys sys 1055700768 5175
 sys/src/9/ip/il.c - 664 sys sys 1184946959 27225
 sys/src/9/ip/inferno.c - 664 sys sys 1022588098 517
-sys/src/9/ip/ip.c - 664 sys sys 1176957040 15288
-sys/src/9/ip/ip.h - 664 sys sys 1184794803 15981
+sys/src/9/ip/ip.c - 664 sys sys 1187037311 14785
+sys/src/9/ip/ip.h - 664 sys sys 1187037311 16477
 sys/src/9/ip/ipaux.c - 664 sys sys 1185486678 12341
 sys/src/9/ip/ipifc.c - 664 sys sys 1184794851 34006
-sys/src/9/ip/ipmux.c - 664 sys sys 1179708314 15363
+sys/src/9/ip/ipmux.c - 664 sys sys 1187047550 14991
 sys/src/9/ip/iproute.c - 664 sys sys 1168305878 14778
-sys/src/9/ip/ipv6.c - 664 sys sys 1184794860 14514
-sys/src/9/ip/ipv6.h - 664 sys sys 1185486283 4322
+sys/src/9/ip/ipv6.c - 664 sys sys 1187036522 14427
+sys/src/9/ip/ipv6.h - 664 sys sys 1187036522 4321
 sys/src/9/ip/loopbackmedium.c - 664 sys sys 1055701769 1671
 sys/src/9/ip/netdevmedium.c - 664 sys sys 1045063517 2675
 sys/src/9/ip/netlog.c - 664 sys sys 1184794933 4004
@@ -8161,14 +8161,14 @@ sys/src/9/port - 20000000775 sys sys 1161222882 0
 sys/src/9/port/alarm.c - 664 sys sys 1134042902 1425
 sys/src/9/port/alloc.c - 664 sys sys 1138459977 5704
 sys/src/9/port/allocb.c - 664 sys sys 1123676437 3340
-sys/src/9/port/aoe.h - 664 sys sys 1186714271 805
+sys/src/9/port/aoe.h - 664 sys sys 1187043215 806
 sys/src/9/port/auth.c - 664 sys sys 1123647282 2392
 sys/src/9/port/cache.c - 664 sys sys 1170456667 9285
 sys/src/9/port/chan.c - 664 sys sys 1146151714 34773
 sys/src/9/port/cis.c - 664 sys sys 1099761153 9248
 sys/src/9/port/debugalloc.c - 664 sys sys 1014931171 10402
 sys/src/9/port/dev.c - 664 sys sys 1146151714 8177
-sys/src/9/port/devaoe.c - 664 sys sys 1186772629 41313
+sys/src/9/port/devaoe.c - 664 sys sys 1187061517 41444
 sys/src/9/port/devaudio.c - 664 sys sys 1170456648 21199
 sys/src/9/port/devbridge.c - 664 sys sys 1185994684 24171
 sys/src/9/port/devcap.c - 664 sys sys 1178886040 4141
@@ -8187,7 +8187,7 @@ sys/src/9/port/devpipe.c - 664 sys sys 1077055016 5825
 sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
 sys/src/9/port/devproc.c - 664 sys sys 1168304324 28543
 sys/src/9/port/devroot.c - 664 sys sys 1146151714 4242
-sys/src/9/port/devsd.c - 664 sys sys 1186618574 31315
+sys/src/9/port/devsd.c - 664 sys sys 1186965855 31275
 sys/src/9/port/devsdp.c - 664 sys sys 1057323393 44800
 sys/src/9/port/devsegment.c - 664 sys sys 1131289891 9610
 sys/src/9/port/devsrv.c - 664 sys sys 1165810571 5711
@@ -8235,7 +8235,7 @@ sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
 sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
 sys/src/9/port/sd.h - 664 sys sys 1186618553 2499
-sys/src/9/port/sdaoe.c - 664 sys sys 1186772635 9983
+sys/src/9/port/sdaoe.c - 664 sys sys 1187034227 9934
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
 sys/src/9/port/semaphore.p - 664 sys sys 1143129797 2424
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
@@ -12473,7 +12473,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 1186210033 8811
+sys/src/cmd/ip/6in4.c - 664 sys sys 1187047430 9714
 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

+ 32 - 0
dist/replica/plan9.log

@@ -49940,3 +49940,35 @@
 1186777805 1 c 386/9loadlitedebug - 775 sys sys 1186776564 220555
 1186777805 2 c 386/bin/unzip - 775 sys sys 1186776392 91093
 1186893621 0 c sys/man/4/fossil - 664 sys sys 1186820346 9592
+1187034278 0 c sys/man/3/fs - 664 sys sys 1186946771 3159
+1187034278 1 c sys/man/3/sdaoe - 664 sys sys 1186965881 1320
+1187034278 2 c sys/src/9/port/devsd.c - 664 sys sys 1186965855 31275
+1187034278 3 c sys/src/9/port/devaoe.c - 664 sys sys 1187034234 41526
+1187034278 4 c sys/src/9/port/sdaoe.c - 664 sys sys 1187034227 9934
+1187037004 0 c sys/src/9/ip/icmp6.c - 664 sys sys 1187036525 18131
+1187037004 1 c sys/src/9/ip/ip.c - 664 sys sys 1187036521 15214
+1187037004 2 c sys/src/9/ip/ip.h - 664 sys sys 1187036521 16017
+1187037004 3 c sys/src/9/ip/ipmux.c - 664 sys sys 1187036521 15052
+1187037004 4 c sys/src/9/ip/ipv6.c - 664 sys sys 1187036522 14427
+1187037004 5 c sys/src/9/ip/ipv6.h - 664 sys sys 1187036522 4321
+1187038804 0 c sys/man/3/ip - 664 sys sys 1187037535 26221
+1187038804 1 c sys/src/9/ip/esp.c - 664 sys sys 1187037502 17754
+1187038804 2 c sys/src/9/ip/ip.c - 664 sys sys 1187037311 14785
+1187038804 3 c sys/src/9/ip/ip.h - 664 sys sys 1187037311 16477
+1187038804 4 c sys/src/9/ip/ipmux.c - 664 sys sys 1187037311 15008
+1187042404 0 c sys/man/3/ip - 664 sys sys 1187041272 26253
+1187044203 0 c sys/man/3/ip - 664 sys sys 1187044239 26189
+1187044203 1 c sys/src/9/port/aoe.h - 664 sys sys 1187043215 806
+1187046004 0 c sys/man/3/ip - 664 sys sys 1187044258 26172
+1187046004 1 c sys/man/8/ppp - 664 sys sys 1187046045 4430
+1187046004 2 c sys/src/9/ip/gre.c - 664 sys sys 1187045851 5103
+1187046004 3 c sys/src/9/ip/ipmux.c - 664 sys sys 1187045850 14981
+1187047803 0 c sys/include/ip.h - 664 sys sys 1187047442 4383
+1187047803 1 c sys/man/3/ip - 664 sys sys 1187046244 26227
+1187047803 2 c sys/src/9/ip/ipmux.c - 664 sys sys 1187047550 14991
+1187047803 3 c sys/src/cmd/ip/6in4.c - 664 sys sys 1187047430 9714
+1187062204 0 c 386/bin/ip/6in4 - 775 sys sys 1187061208 91687
+1187062204 1 c 386/lib/libip.a - 664 sys sys 1187061208 34710
+1187062204 2 c 386/lib/libndb.a - 664 sys sys 1187061208 64470
+1187062204 3 c 386/lib/libsunrpc.a - 664 sys sys 1187061209 353148
+1187062204 4 c sys/src/9/port/devaoe.c - 664 sys sys 1187061517 41444

+ 5 - 1
sys/include/ip.h

@@ -8,6 +8,10 @@ enum
 	IPv4off=	12,
 	IPllen=		4,
 	IPV4HDR_LEN=	20,
+
+	/* vihl & vcf[0] values */
+	IP_VER4= 	0x40,
+	IP_VER6=	0x60,
 };
 
 /*
@@ -128,7 +132,7 @@ struct Ip6hdr {
  */
 typedef struct Icmp6hdr Icmp6hdr;
 struct Icmp6hdr {
-	uchar	unused[8];
+	uchar	_0_[8];
 	uchar	laddr[IPaddrlen];	/* local address */
 	uchar	raddr[IPaddrlen];	/* remote address */
 };

+ 54 - 46
sys/man/3/ip

@@ -44,9 +44,12 @@ ip \- network protocols over IP
 .1C
 .fi
 .SH DESCRIPTION
-The IP device provides the interface to Internet protocol stacks.
+The
+.I ip
+device provides the interface to Internet Protocol stacks.
 .I Spec
 is an integer from 0 to 15 identifying a stack.
+Each stack implements IPv4 and IPv6.
 Each stack is independent of all others:
 the only information transfer between them is via programs that
 mount multiple stacks.
@@ -56,7 +59,6 @@ new IP networks or implementing firewalls or proxy
 services.
 .PP
 All addresses used are 16-byte IPv6 addresses.
-The IP device implements IPv4 and IPv6.
 IPv4 addresses are a subset of the IPv6 addresses and both standard
 .SM ASCII
 formats are accepted.
@@ -65,8 +67,8 @@ In binary representation, all v4 addresses start with the 12 bytes, in hex:
 .EX
 00 00 00 00 00 00 00 00 00 00 ff ff
 .EE
+.
 .SS "Configuring interfaces
-.PP
 Each stack may have multiple interfaces and each interface
 may have multiple addresses.
 The
@@ -108,7 +110,7 @@ The kernel will
 .IR path !0x800
 and
 .IR path !0x806
-and use the two connections for IP and
+and use the two connections for IPv4 and
 ARP respectively.
 .TP
 .B "bind pkt
@@ -312,8 +314,8 @@ See
 .I readipifc
 in
 .IR ip (2).
+.
 .SS "Routing
-.PP
 The file
 .I iproute
 controls information about IP routing.
@@ -324,7 +326,8 @@ tag, and interface number.
 The entry used for routing an IP packet is the one with
 the longest mask for which destination address ANDed with
 target mask equals the target address.
-The one character flags are:
+The one-character flags are:
+.TF m
 .TP
 .B 4
 IPv4 route
@@ -346,6 +349,7 @@ multicast route
 .TP
 .B p
 point-to-point route
+.PD
 .PP
 The tag is an arbitrary, up to 4 character, string.  It is normally used to
 indicate what routing protocol originated the route.
@@ -370,8 +374,8 @@ same target and mask, replace it.
 .TP
 .BI remove\  "target mask"
 Remove a route with a matching target and mask.
+.
 .SS "Address resolution
-.PP
 The file
 .B /net/arp
 controls information about address resolution.
@@ -409,8 +413,8 @@ Currently, the only medium type is
 .BR ether .
 .br
 .ne 3
+.
 .SS "Debugging and stack information
-.PP
 If any process is holding
 .B /net/log
 open, the IP stack queues debugging information to it.
@@ -421,8 +425,9 @@ about bad packets.
 .PP
 Writing to
 .B /net/log
-controls debugging.  The control messages
-are:
+controls debugging.  The control messages are:
+.TF "clear addr"
+.PD
 .TP
 .BI set\  arglist
 .I Arglist
@@ -481,8 +486,8 @@ entries.
 Note that the `IPv4 route' flag will never be set.
 .br
 .ne 3
+.
 .SS "Protocol directories
-.PP
 The
 .I ip
 device
@@ -547,13 +552,13 @@ file (see
 to receive incoming calls.
 .PP
 The following control messages are supported:
-.TF "bind X"
+.TF announceX
 .PD
 .TP
-.BI connect\  ipaddress ! port "!r " local
-Establish a connection to the remote address
-.I ipaddress
-and remote port
+.BI connect\  ip-address ! port "!r " local
+Establish a connection to the remote
+.I ip-address
+and
 .IR port .
 If
 .I local
@@ -656,8 +661,8 @@ This procedure will accept all calls for the
 given protocol.
 See
 .IR dial (2).
+.
 .SS TCP
-.PP
 TCP connections are reliable point-to-point byte streams; there are no
 message delimiters.
 A connection is determined by the address and port numbers of the two
@@ -676,8 +681,8 @@ turn on keep alive messages.
 .IR N ,
 if given, is the milliseconds between keepalives
 (default 30000).
+.
 .SS UDP
-.PP
 UDP connections carry unreliable and unordered datagrams.  A read from
 .B data
 will return the next datagram, discarding anything
@@ -696,15 +701,16 @@ However, many-to-one semantics is also possible.
 .PP
 If, after an
 .BR announce ,
-the following message is written to
+the message
+.L headers
+is written to
 .BR ctl ,
 then all messages sent to the announced port
 are received on the announced connection prefixed
 with the corresponding structure,
 declared in
-.BR <ip.h> .
-.TP
-.B headers
+.BR <ip.h> :
+.IP
 .EX
 typedef struct Udphdr Udphdr;
 struct Udphdr
@@ -729,8 +735,6 @@ read.
 .PP
 In this case (writing
 .L headers
-or
-.L noheaders
 to the
 .I ctl
 file),
@@ -747,8 +751,8 @@ the usual sequence of
 must be executed before performing I/O on the corresponding
 .I data
 file.
+.
 .SS RUDP
-.PP
 RUDP is a reliable datagram protocol based on UDP.
 Packets are delivered in order.
 RUDP does not support
@@ -782,24 +786,26 @@ is treated like a reboot:
 all queued messages are dropped, an error is queued to the
 .B err
 file, and the conversation resumes.
+.
 .SS ICMP
-.PP
 ICMP is a datagram protocol for IPv4 used to exchange control requests and
 their responses with other machines' IP implementations.
 ICMP is primarily a kernel-to-kernel protocol, but it is possible
 to generate `echo request' and read `echo reply' packets from user programs.
+.
 .SS ICMPV6
 ICMPv6 is the IPv6 equivalent of ICMP.
 If, after an
 .BR announce ,
-the following message is written to
+the message
+.L headers
+is written to
 .BR ctl ,
 then before a write,
 a user must prefix each message with a corresponding structure,
 declared in
-.BR <ip.h> .
-.TP
-.B headers
+.BR <ip.h> :
+.IP
 .EX
 /*
  *  user level icmpv6 with control message "headers"
@@ -830,8 +836,8 @@ the usual sequence of
 must be executed before performing I/O on the corresponding
 .I data
 file.
+.
 .SS IL
-.PP
 IL is a reliable point-to-point datagram protocol that runs over IPv4.
 Like TCP, IL delivers datagrams
 reliably and in order. Also like TCP, a connection is
@@ -845,11 +851,12 @@ It is no longer necessary, except to communicate with old standalone
 .IR fs (4)
 file servers.
 Its use is now deprecated.
+.
 .SS GRE
-.PP
 GRE is the encapsulation protocol used by PPTP.
 The kernel implements just enough of the protocol
 to multiplex it.
+Our implementation encapsulates in IPv4, per RFC 1702.
 .B Announce
 is not allowed in GRE, only
 .BR connect .
@@ -866,12 +873,11 @@ field with the port number specified
 in the connect message.
 .br
 .ne 3
+.
 .SS ESP
-.PP
 ESP is the Encapsulating Security Payload (RFC 1827, obsoleted by RFC 4303)
 for IPsec (RFC 4301).
-We currently implement ESP only over IPv4 and
-only tunnel mode, not transport mode.
+We currently implement only tunnel mode, not transport mode.
 It is used to set up an encrypted tunnel between machines.
 Like GRE, ESP has no port numbers.  Instead, the
 port number in the
@@ -899,8 +905,11 @@ as the key.
 Possible algorithms are:
 .BR null ,
 .BR des_56_cbc ,
+and eventually
+.BR des3_cbc ,
+.BR aes_128_cbc ,
 and
-.BR rc4_128 .
+.BR aes_ctr .
 .TP
 .BI ah\  "alg secret
 Use the hash algorithm,
@@ -911,8 +920,9 @@ as the key for generating the MAC.
 Possible algorithms are:
 .BR null ,
 .BR hmac_sha1_96 ,
-and
-.BR hmac_md5_96 .
+.BR hmac_md5_96 ,
+and eventually
+.BR aes_xcbc_mac_96 .
 .TP
 .B header
 Turn on header mode.  Every buffer read from
@@ -924,13 +934,13 @@ are ignored.
 .TP
 .B noheader
 Turn off header mode.
+.
 .SS "IP packet filter
-.PP
 The directory
 .B /net/ipmux
 looks like another protocol directory.
-It is a packet filter built on top of IP
-(currently IPv4 only).  Each numbered
+It is a packet filter built on top of IP.
+Each numbered
 subdirectory represents a different filter.
 The connect messages written to the
 .I ctl
@@ -943,7 +953,7 @@ file are routed to an interface and transmitted.
 A filter is a semicolon-separated list of
 relations.  Each relation describes a portion
 of a packet to match.  The possible relations are:
-.TF "ifc=expr"
+.TF "iph[n:m]=expr"
 .PD
 .TP
 .BI proto= n
@@ -1024,13 +1034,13 @@ OSPF in Inferno
 and 6to4 tunnelling.
 .br
 .ne 5
+.
 .SS Statistics
-.PP
 The
 .B stats
 files are read only and contain statistics useful to network monitoring.
 .br
-.ne 14
+.ne 12
 .PP
 Reading
 .B /net/ipifc/stats
@@ -1189,5 +1199,3 @@ ICMPv6
 .I Ipmux
 has not been heavily used and should be considered experimental.
 It may disappear in favor of a more traditional packet filter in the future.
-.PP
-Too much of this machinery has not yet been updated for IPv6.

+ 3 - 2
sys/man/8/ppp

@@ -1,6 +1,6 @@
 .TH PPP 8
 .SH NAME
-ppp, pppoe, pptp, pptpd \- point to point protocol
+ppp, pppoe, pptp, pptpd \- point-to-point protocol
 .SH SYNOPSIS
 .B ip/ppp
 [
@@ -93,7 +93,8 @@ ppp, pppoe, pptp, pptpd \- point to point protocol
 ]
 .I tcp-dir
 .SH DESCRIPTION
-The Point to Point Protocol is used to encapsulate Internet Protocol packets
+The Point-to-Point Protocol is used to encapsulate Internet Protocol packets
+in IPv4 packets
 for transfer over serial lines or other protocol connections.
 .I Ppp
 can run either as a client or, with the

+ 28 - 12
sys/src/9/ip/esp.c

@@ -18,15 +18,15 @@ typedef struct Userhdr Userhdr;
 typedef struct Esppriv Esppriv;
 typedef struct Espcb Espcb;
 typedef struct Algorithm Algorithm;
-typedef struct Esprc4 Esprc4;
+// typedef struct Esprc4 Esprc4;
 
 #define DPRINT if(0)print
 
 enum
 {
-	IP_ESPPROTO	= 50,
-	EsphdrSize	= 28,	/* includes IPv4 header */
-	IphdrSize	= 20,	/* IPv4: options have been stripped */
+	IP_ESPPROTO	= 50,	/* IP v4 and v6 protocol number */
+	EsphdrSize	= IP4HDR + 8,
+
 	EsptailSize	= 2,	/* does not include pad or auth data */
 	UserhdrSize	= 4,	/* user-visible header size - if enabled */
 };
@@ -104,6 +104,7 @@ enum {
 	RC4back = 100*1024,	/* maximum look back */
 };
 
+#ifdef notdef
 struct Esprc4
 {
 	ulong	cseq;		/* current byte sequence number */
@@ -114,30 +115,37 @@ struct Esprc4
 	ulong	oseq;		/* old byte sequence number */
 	RC4state old;
 };
+#endif
 
 static	Conv* convlookup(Proto *esp, ulong spi);
 static	char *setalg(Espcb *ecb, char **f, int n, Algorithm *alg);
+static	void espkick(void *x);
+
 static	void nullespinit(Espcb*, char*, uchar *key, int keylen);
+static	void desespinit(Espcb *ecb, char *name, uchar *k, int n);
+// static void rc4espinit(Espcb *ecb, char *name, uchar *k, int n);
+
 static	void nullahinit(Espcb*, char*, uchar *key, int keylen);
 static	void shaahinit(Espcb*, char*, uchar *key, int keylen);
 static	void md5ahinit(Espcb*, char*, uchar *key, int keylen);
-static	void desespinit(Espcb *ecb, char *name, uchar *k, int n);
-static	void rc4espinit(Espcb *ecb, char *name, uchar *k, int n);
-static	void espkick(void *x);
 
 static Algorithm espalg[] =
 {
 	"null",			0,	nullespinit,
-	"des_56_cbc",		64,	desespinit,
-	"rc4_128",		128,	rc4espinit,
+//	"des3_cbc",		192,	des3espinit,	/* rfc2451 */
+//	"aes_128_cbc",		128,	aescbcespinit,	/* rfc3602 */
+//	"aes_ctr",		128,	aesctrespinit,	/* rfc3686 */
+	"des_56_cbc",		64,	desespinit,	/* rfc2405, deprecated */
+//	"rc4_128",		128,	rc4espinit,	/* gone in rfc4305 */
 	nil,			0,	nil,
 };
 
 static Algorithm ahalg[] =
 {
 	"null",			0,	nullahinit,
-	"hmac_sha1_96",		128,	shaahinit,
-	"hmac_md5_96",		128,	md5ahinit,
+	"hmac_sha1_96",		128,	shaahinit,	/* rfc2404 */
+//	"aes_xcbc_mac_96",	128,	aesahinit,	/* rfc3566 */
+	"hmac_md5_96",		128,	md5ahinit,	/* rfc2403 */
 	nil,			0,	nil,
 };
 
@@ -258,6 +266,7 @@ espkick(void *x)
 
 	payload = BLEN(bp) + ecb->espivlen;
 
+/* adapt to v6 */
 	/* Make space to fit ip header */
 	bp = padblock(bp, EsphdrSize + ecb->espivlen);
 
@@ -296,12 +305,13 @@ espkick(void *x)
 	eh->frag[0] = 0;
 	eh->frag[1] = 0;
 
-	ecb->auth(ecb, bp->rp + IphdrSize, (EsphdrSize - IphdrSize) +
+	ecb->auth(ecb, bp->rp + IP4HDR, (EsphdrSize - IP4HDR) +
 		payload + pad + EsptailSize, auth);
 
 	qunlock(c);
 	/* print("esp: pass down: %uld\n", BLEN(bp)); */
 	ipoput4(c->p->f, bp, 0, c->ttl, c->tos, c);
+/* end adapt to v6 */
 }
 
 void
@@ -326,10 +336,12 @@ espiput(Proto *esp, Ipifc*, Block *bp)
 		return;
 	}
 
+/* adapt to v6 */
 	eh = (Esphdr*)(bp->rp);
 	spi = nhgetl(eh->espspi);
 	v4tov6(raddr, eh->espsrc);
 	v4tov6(laddr, eh->espdst);
+/* end adapt to v6 */
 
 	qlock(esp);
 	/* Look for a conversation structure for this port */
@@ -351,6 +363,7 @@ espiput(Proto *esp, Ipifc*, Block *bp)
 	if(bp->next)
 		bp = concatblock(bp);
 
+/* adapt to v6 */
 	if(BLEN(bp) < EsphdrSize + ecb->espivlen + EsptailSize + ecb->ahlen) {
 		qunlock(c);
 		netlog(f, Logesp, "esp: short block %I -> %I!%d\n", raddr,
@@ -409,6 +422,7 @@ print("esp: cipher failed %I -> %I!%ld: %s\n", raddr, laddr, spi, up->errstr);
 		memset(uh, 0, UserhdrSize);
 		uh->nexthdr = nexthdr;
 	}
+/* end adapt to v6 */
 
 	if(qfull(c->rq)){
 		netlog(f, Logesp, "esp: qfull %I -> %I.%uld\n", raddr,
@@ -748,6 +762,7 @@ desespinit(Espcb *ecb, char *name, uchar *k, int n)
 	setupDESstate(ecb->espstate, key, ivec);
 }
 
+#ifdef notdef
 static int
 rc4cipher(Espcb *ecb, uchar *p, int n)
 {
@@ -836,6 +851,7 @@ rc4espinit(Espcb *ecb, char *name, uchar *k, int n)
 	ecb->cipher = rc4cipher;
 	ecb->espstate = esprc4;
 }
+#endif
 
 void
 espinit(Fs *fs)

+ 3 - 2
sys/src/9/ip/gre.c

@@ -1,3 +1,6 @@
+/*
+ * Generic Routing Encapsulation over IPv4, rfc1702
+ */
 #include "u.h"
 #include "../port/lib.h"
 #include "mem.h"
@@ -7,8 +10,6 @@
 
 #include "ip.h"
 
-#define DPRINT if(0)print
-
 enum
 {
 	GRE_IPONLY	= 12,		/* size of ip header */

+ 3 - 3
sys/src/9/ip/icmp6.c

@@ -184,7 +184,7 @@ set_cksum(Block *bp)
 	IPICMP *p = (IPICMP *)(bp->rp);
 
 	hnputl(p->vcf, 0);  	/* borrow IP header as pseudoheader */
-	hnputs(p->ploadlen, blocklen(bp)-IPV6HDR_LEN);
+	hnputs(p->ploadlen, blocklen(bp) - IP6HDR);
 	p->proto = 0;
 	p->ttl = ICMPv6;	/* ttl gets set later */
 	hnputs(p->cksum, 0);
@@ -564,7 +564,7 @@ valid(Proto *icmp, Ipifc *ifc, Block *bp, Icmppriv6 *ipriv)
 	}
 
 	iplen = nhgets(p->ploadlen);
-	if(iplen > n-IPV6HDR_LEN || (iplen % 1)) {
+	if(iplen > n - IP6HDR || (iplen % 1) != 0) {
 		ipriv->stats[LenErrs6]++;
 		netlog(icmp->f, Logicmp, "icmp length %d\n", iplen);
 		goto err;
@@ -580,7 +580,7 @@ valid(Proto *icmp, Ipifc *ifc, Block *bp, Icmppriv6 *ipriv)
 	ttl = p->ttl;
 	p->ttl = p->proto;
 	p->proto = 0;
-	if(ptclcsum(bp, 0, iplen + IPV6HDR_LEN)) {
+	if(ptclcsum(bp, 0, iplen + IP6HDR)) {
 		ipriv->stats[CsumErrs6]++;
 		netlog(icmp->f, Logicmp, "icmp checksum error\n");
 		goto err;

+ 1 - 18
sys/src/9/ip/ip.c

@@ -7,7 +7,6 @@
 
 #include	"ip.h"
 
-typedef struct Ip4hdr		Ip4hdr;
 typedef struct IP		IP;
 typedef struct Fragment4	Fragment4;
 typedef struct Fragment6	Fragment6;
@@ -15,8 +14,6 @@ typedef struct Ipfrag		Ipfrag;
 
 enum
 {
-	IP4HDR		= 20,		/* sizeof(Ip4hdr) */
-	IP6HDR		= 40,		/* sizeof(Ip6hdr) */
 	IP_HLEN4	= 0x05,		/* Header length in words */
 	IP_DF		= 0x4000,	/* Don't fragment */
 	IP_MF		= 0x2000,	/* More fragments */
@@ -26,20 +23,6 @@ enum
 
 #define BLKIPVER(xp)	(((Ip4hdr*)((xp)->rp))->vihl&0xF0)
 
-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 */
-};
-
 /* MIB II counters */
 enum
 {
@@ -460,7 +443,7 @@ ipiput4(Fs *f, Ipifc *ifc, Block *bp)
 			freeblist(bp);
 			return;
 		}
-	  /* If this is not routed strip off the options */
+		/* If this is not routed strip off the options */
 		if(notforme == 0) {
 			olen = nhgets(h->length);
 			dp = bp->rp + (hl - (IP_HLEN4<<2));

+ 17 - 0
sys/src/9/ip/ip.h

@@ -51,6 +51,7 @@ enum
 	V6=		6,
 	IP_VER4= 	0x40,
 	IP_VER6=	0x60,
+	IP4HDR=		20,		/* sizeof(Ip4hdr) */
 
 	/* 2^Lroot trees in the root table */
 	Lroot=		10,
@@ -67,6 +68,22 @@ enum
 	Connected=	4,
 };
 
+/* on the wire packet header */
+typedef struct Ip4hdr		Ip4hdr;
+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 */
+};
+
 /*
  *  one per conversation directory
  */

+ 19 - 36
sys/src/9/ip/ipmux.c

@@ -1,3 +1,6 @@
+/*
+ * IP packet filter
+ */
 #include "u.h"
 #include "../port/lib.h"
 #include "mem.h"
@@ -6,19 +9,13 @@
 #include "../port/error.h"
 
 #include "ip.h"
-#define DPRINT if(0)print
+#include "ipv6.h"
 
 typedef struct Ipmuxrock  Ipmuxrock;
 typedef struct Ipmux      Ipmux;
-typedef struct Ip4hdr     Ip4hdr;
-typedef struct Ip6hdr     Ip6hdr;
-
-enum
-{
-	IPHDR		= 20,		/* sizeof(Ip4hdr) */
-};
 
-struct Ip4hdr
+typedef struct Myip4hdr Myip4hdr;
+struct Myip4hdr
 {
 	uchar	vihl;		/* Version and header length */
 	uchar	tos;		/* Type of service */
@@ -30,20 +27,10 @@ struct Ip4hdr
 	uchar	cksum[2];	/* Header checksum */
 	uchar	src[4];		/* IP source */
 	uchar	dst[4];		/* IP destination */
-	uchar	data[1];	/* start of data */
-};
-Ip4hdr *ipoff = 0;
 
-struct Ip6hdr
-{
-	uchar vcf[4];		/* version, class label, and flow label */ 
-	uchar ploadlen[2];	/* payload length */
-	uchar proto;		/* next header, i.e. proto */
-	uchar ttl;		/* hop limit, i.e. ttl */
-	uchar src[16];		/* IP source */
-	uchar dst[16];		/* IP destination */
+	uchar	data[1];	/* start of data */
 };
-
+Myip4hdr *ipoff = 0;
 
 enum
 {
@@ -177,7 +164,7 @@ parseop(char **pp)
 			return nil;
 		p++;
 		off = strtoul(p, &p, 0);
-		if(off < 0 || off > (64-IPHDR))
+		if(off < 0 || off > (64-IP4HDR))
 			return nil;
 		p = skipwhite(p);
 		if(*p != ':')
@@ -657,19 +644,15 @@ ipmuxkick(void *x)
 {
 	Conv *c = x;
 	Block *bp;
-	struct Ip6hdr *ih6;
 
 	bp = qget(c->wq);
-	if(bp == nil)
-		return;
-	else {
-		Ip4hdr *ih4 = (Ip4hdr*)(bp->rp);
-		if((ih4->vihl)&0xF0 != 0x60)
+	if(bp != nil) {
+		Myip4hdr *ih4 = (Myip4hdr*)(bp->rp);
+
+		if((ih4->vihl & 0xF0) != IP_VER6)
 			ipoput4(c->p->f, bp, 0, ih4->ttl, ih4->tos, nil);
-		else {
-			ih6 = (struct Ip6hdr*)ih4;
-			ipoput6(c->p->f, bp, 0, ih6->ttl, 0, nil);
-		}
+		else
+			ipoput6(c->p->f, bp, 0, ((Ip6hdr*)ih4)->ttl, 0, nil);
 	}
 }
 
@@ -681,10 +664,10 @@ ipmuxiput(Proto *p, Ipifc *ifc, Block *bp)
 	uchar *m, *h, *v, *e, *ve, *hp;
 	Conv *c;
 	Ipmux *mux;
-	Ip4hdr *ip;
+	Myip4hdr *ip;
 	Ip6hdr *ip6;
 
-	ip = (Ip4hdr*)bp->rp;
+	ip = (Myip4hdr*)bp->rp;
 	hl = (ip->vihl&0x0F)<<2;
 
 	if(p->priv == nil)
@@ -771,8 +754,8 @@ yes:
 
 nomatch:
 	/* doesn't match any filter, hand it to the specific protocol handler */
-	ip = (Ip4hdr*)bp->rp;
-	if((ip->vihl&0xF0)==0x40) {
+	ip = (Myip4hdr*)bp->rp;
+	if((ip->vihl & 0xF0) == IP_VER4) {
 		p = f->t2p[ip->proto];
 	} else {
 		ip6 = (Ip6hdr*)bp->rp;

+ 3 - 5
sys/src/9/ip/ipv6.c

@@ -10,8 +10,6 @@
 
 enum
 {
-	IP4HDR		= 20,		/* sizeof(Ip4hdr) */
-	IP6HDR		= 40,		/* sizeof(Ip6hdr) */
 	IP_HLEN4	= 0x05,		/* Header length in words */
 	IP_DF		= 0x4000,	/* Don't fragment */
 	IP_MF		= 0x2000,	/* More fragments */
@@ -167,8 +165,8 @@ ipoput6(Fs *f, Block *bp, int gating, int ttl, int tos, Conv *c)
 			netlog(f, Logip, "short gated packet\n");
 			goto free;
 		}
-		if(chunk + IPV6HDR_LEN < len)
-			len = chunk + IPV6HDR_LEN;
+		if(chunk + IP6HDR < len)
+			len = chunk + IP6HDR;
 	}
 
 	if(len >= IP_MAX){
@@ -221,7 +219,7 @@ ipoput6(Fs *f, Block *bp, int gating, int ttl, int tos, Conv *c)
 	/* If we dont need to fragment just send it */
 	medialen = ifc->maxtu - ifc->m->hsize;
 	if(len <= medialen) {
-		hnputs(eh->ploadlen, len-IPV6HDR_LEN);
+		hnputs(eh->ploadlen, len - IP6HDR);
 		ifc->m->bwrite(ifc, bp, V6, gate);
 		runlock(ifc);
 		poperror();

+ 1 - 2
sys/src/9/ip/ipv6.h

@@ -79,8 +79,7 @@ enum {
 	v6MINTU		= 1280,
 	HOP_LIMIT	= 255,
 	ETHERHDR_LEN	= 14,
-	IPV6HDR_LEN	= 40,
-	IPV4HDR_LEN	= 20,
+	IP6HDR		= 20,		/* sizeof(Ip6hdr) */
 
 	/* option types */
 

+ 1 - 1
sys/src/9/port/aoe.h

@@ -24,7 +24,7 @@ enum {
 
 enum {
 	Aoetype	= 0x88a2,
-	Aoesectsz = 512,			/* assumed sector size */
+	Aoesectsz = 512,			/* standard sector size */
 	Aoever	= 1,
 
 	AFerr	= 1<<2,

+ 8 - 3
sys/src/9/port/devaoe.c

@@ -740,7 +740,7 @@ unitgen(Chan *c, ulong type, Dir *dp)
 	Qid q;
 
 	d = unit2dev(UNIT(c->qid));
-	perm = 0666;
+	perm = 0644;
 	size = 0;
 	vers = d->vers;
 	t = QTFILE;
@@ -753,6 +753,7 @@ unitgen(Chan *c, ulong type, Dir *dp)
 		break;
 	case Qdata:
 		p = "data";
+		perm = 0640;
 		if(UP(d))
 			size = d->bsize;
 		break;
@@ -1128,9 +1129,13 @@ rw(Aoedev *d, int write, uchar *db, long len, uvlong off)
 	enum { Srbsz = 1<<18, };
 	Srb *srb;
 
+	/*
+	 * it would be good if we could relax this, to match all other
+	 * disk drivers in Plan 9.
+	 */
 	if((off|len) & (Aoesectsz-1))
 		error("offset and length must be sector multiple.\n");
-	if(off > d->bsize)
+	if(off > d->bsize || len == 0)
 		return 0;
 	if(off + len > d->bsize)
 		len = d->bsize - off;
@@ -1213,7 +1218,7 @@ pstat(Aoedev *d, char *db, int len, int off)
 	p = seprint(p, e,
 		"state: %s\n"	"nopen: %d\n"	"nout: %d\n"
 		"nmaxout: %d\n"	"nframes: %d\n"	"maxbcnt: %d\n"
-		"fw: %d\n"
+		"fw: %.4ux\n"
 		"model: %s\n"	"serial: %s\n"	"firmware: %s\n",
 		state,		d->nopen,	d->nout,
 		d->maxout, 	d->nframes,	d->maxbcnt,

+ 1 - 1
sys/src/9/port/sdaoe.c

@@ -452,7 +452,7 @@ aoeonline(SDunit *u)
 		c->mediachange = 0;
 		u->sectors = c->sectors;
 		u->secsize = Aoesectsz;
-	} else if(devtab[c->c->type]->read(c->c, 0, 0, 0) == 0)
+	} else
 		r = 1;
 
 	return r;

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

@@ -253,6 +253,31 @@ main(int argc, char **argv)
 	runtunnel(v6net, tunnel);
 }
 
+/*
+ * based on libthread's threadsetname, but drags in less library code.
+ * actually just sets the arguments displayed.
+ */
+void
+procsetname(char *fmt, ...)
+{
+	int fd;
+	char *cmdname;
+	char buf[128];
+	va_list arg;
+
+	va_start(arg, fmt);
+	cmdname = vsmprint(fmt, arg);
+	va_end(arg);
+	if (cmdname == nil)
+		return;
+	snprint(buf, sizeof buf, "#p/%d/args", getpid());
+	if((fd = open(buf, OWRITE)) >= 0){
+		write(fd, cmdname, strlen(cmdname)+1);
+		close(fd);
+	}
+	free(cmdname);
+}
+
 /*
  * encapsulate v6 packets from the packet interface in v4 ones
  * and send them into the tunnel.
@@ -265,9 +290,14 @@ ip2tunnel(int in, int out)
 	Iphdr *op;
 	Ip6hdr *ip;
 
+	if (anysender)
+		procsetname("v6 %I -> tunnel", local6);
+	else
+		procsetname("v6 %I -> tunnel %I %I", local6, remote4, remote6);
+
 	/* populate v4 header */
 	op = (Iphdr*)buf;
-	op->vihl = 0x45;		/* v4, hdr is 5 longs? */
+	op->vihl = IP_VER4 | 5;		/* hdr is 5 longs? */
 	memcpy(op->src, myip + IPv4off, sizeof op->src);
 	op->proto = IP_IPV6PROTO;
 	op->ttl = 100;
@@ -276,7 +306,7 @@ ip2tunnel(int in, int out)
 	while ((n = read(in, buf + STFHDR, sizeof buf - STFHDR)) > 0) {
 		/* if not IPV6, drop it */
 		ip = (Ip6hdr*)(buf + STFHDR);
-		if ((ip->vcf[0]&0xF0) != 0x60)
+		if ((ip->vcf[0] & 0xF0) != IP_VER6)
 			continue;
 
 		/* check length: drop if too short, trim if too long */
@@ -294,6 +324,8 @@ ip2tunnel(int in, int out)
 			continue;
 		}
 
+		if (debug > 1)
+			fprint(2, "v6 to tunnel %I -> %I\n", ip->src, ip->dst);
 		/* send 6to4 packets directly to ipv4 target */
 		if ((ip->dst[0]<<8 | ip->dst[1]) == V6to4pfx)
 			memcpy(op->dst, ip->dst+2, sizeof op->dst);
@@ -322,6 +354,11 @@ tunnel2ip(int in, int out)
 	Ip6hdr *op;
 	Iphdr *ip;
 
+	if (anysender)
+		procsetname("tunnel -> v6 %I", local6);
+	else
+		procsetname("tunnel %I %I -> v6 %I", remote4, remote6, local6);
+
 	for (;;) {
 		/* get a packet from the tunnel */
 		n = read(in, buf, sizeof buf);
@@ -333,7 +370,7 @@ tunnel2ip(int in, int out)
 		}
 
 		/* if not IPv4 nor IPv4 protocol IPv6, drop it */
-		if ((ip->vihl&0xF0) != 0x40 || ip->proto != IP_IPV6PROTO)
+		if ((ip->vihl & 0xF0) != IP_VER4 || ip->proto != IP_IPV6PROTO)
 			continue;
 
 		/* check length: drop if too short, trim if too long */
@@ -356,6 +393,8 @@ tunnel2ip(int in, int out)
 				op->src, op->dst);
 			continue;
 		}
+		if (debug > 1)
+			fprint(2, "tunnel to v6 %I -> %I\n", op->src, op->dst);
 
 		/* pass V6 packet to the interface */
 		if (write(out, op, n) != n) {