Browse Source

Plan 9 from Bell Labs 2003-04-19

David du Colombier 18 years ago
parent
commit
72088e4913

+ 38 - 36
dist/replica/plan9.db

@@ -119,13 +119,13 @@
 386/bin/aux/mswordstrings - 775 sys sys 1039758542 64268
 386/bin/aux/na - 775 sys sys 1045537953 152774
 386/bin/aux/nfsmount - 775 sys sys 1048745020 231410
-386/bin/aux/nfsserver - 775 sys sys 1045537954 171046
+386/bin/aux/nfsserver - 775 sys sys 1050715127 171093
 386/bin/aux/olefs - 775 sys sys 1048745021 144846
 386/bin/aux/p9bitpost - 775 sys sys 1047307246 128070
 386/bin/aux/pcmcia - 775 sys sys 1039758543 46790
-386/bin/aux/pcnfsd - 775 sys sys 1045537955 126750
+386/bin/aux/pcnfsd - 775 sys sys 1050715126 126789
 386/bin/aux/portmap - 775 sys sys 1049840989 141624
-386/bin/aux/portmapper - 775 sys sys 1045537955 125638
+386/bin/aux/portmapper - 775 sys sys 1050715127 125677
 386/bin/aux/postgif - 775 sys sys 1048745022 174648
 386/bin/aux/postprint - 775 sys sys 1048745023 159149
 386/bin/aux/postreverse - 775 sys sys 1048745024 164587
@@ -140,7 +140,7 @@
 386/bin/aux/stub - 775 sys sys 1048745027 135570
 386/bin/aux/tcpostio - 775 sys sys 1048745028 196997
 386/bin/aux/text2post - 775 sys sys 1039758546 77253
-386/bin/aux/timesync - 775 sys sys 1048745029 127649
+386/bin/aux/timesync - 775 sys sys 1050714589 127691
 386/bin/aux/tr2post - 775 sys sys 1045537960 175522
 386/bin/aux/trampoline - 775 sys sys 1045537960 81157
 386/bin/aux/typepasswd - 775 sys sys 1045537960 68154
@@ -247,7 +247,7 @@
 386/bin/import - 775 sys sys 1048745047 87897
 386/bin/iostats - 775 sys sys 1045538016 98803
 386/bin/ip - 20000000775 sys sys 1016920851 0
-386/bin/ip/dhcpclient - 775 sys sys 1045538016 91665
+386/bin/ip/dhcpclient - 775 sys sys 1050714751 92362
 386/bin/ip/dhcpd - 775 sys sys 1045538017 144977
 386/bin/ip/dhcpleases - 775 sys sys 1045538017 84658
 386/bin/ip/ftpd - 775 sys sys 1048799692 167273
@@ -260,7 +260,7 @@
 386/bin/ip/httpd/save - 775 sys sys 1045538021 130989
 386/bin/ip/httpd/wikipost - 775 sys sys 1045538021 111347
 386/bin/ip/imap4d - 775 sys sys 1048799694 233020
-386/bin/ip/ipconfig - 775 sys sys 1045538022 103751
+386/bin/ip/ipconfig - 775 sys sys 1050714743 102456
 386/bin/ip/ping - 775 sys sys 1039758569 74005
 386/bin/ip/ppp - 775 sys sys 1050419687 215306
 386/bin/ip/pppoe - 775 sys sys 1050419688 75481
@@ -273,7 +273,7 @@
 386/bin/ip/telnetd - 775 sys sys 1048799696 120198
 386/bin/ip/tftpd - 775 sys sys 1045538025 102539
 386/bin/ip/traceroute - 775 sys sys 1039758572 70850
-386/bin/ip/udpecho - 775 sys sys 1039758572 43540
+386/bin/ip/udpecho - 775 sys sys 1050714732 43574
 386/bin/join - 775 sys sys 1045538026 114439
 386/bin/jpg - 775 sys sys 1045538027 172815
 386/bin/kprof - 775 sys sys 1045538027 101902
@@ -297,8 +297,8 @@
 386/bin/ndb - 20000000775 sys sys 985743147 0
 386/bin/ndb/cs - 775 sys sys 1049377481 143599
 386/bin/ndb/csquery - 775 sys sys 1039758577 60136
-386/bin/ndb/dns - 775 sys sys 1049428257 211411
-386/bin/ndb/dnsdebug - 775 sys sys 1049428257 186400
+386/bin/ndb/dns - 775 sys sys 1050714846 211399
+386/bin/ndb/dnsdebug - 775 sys sys 1050714853 186310
 386/bin/ndb/dnsquery - 775 sys sys 1039758578 62442
 386/bin/ndb/dnstcp - 775 sys sys 1049428258 185185
 386/bin/ndb/ipquery - 775 sys sys 1045538035 91678
@@ -476,7 +476,7 @@
 386/lib - 20000000775 sys sys 1016826328 0
 386/lib/ape - 20000000775 sys sys 944969312 0
 386/lib/ape/lib9.a - 664 sys sys 1038237538 6378
-386/lib/ape/libap.a - 664 sys sys 1048745123 780492
+386/lib/ape/libap.a - 664 sys sys 1050684345 796804
 386/lib/ape/libbsd.a - 664 sys sys 1048745124 175342
 386/lib/ape/libl.a - 664 sys sys 1038237542 8666
 386/lib/ape/libnet.a - 664 sys sys 1038237543 16604
@@ -3242,7 +3242,7 @@ sys/include/ape/select.h - 664 sys sys 944948760 779
 sys/include/ape/setjmp.h - 664 sys sys 944948760 421
 sys/include/ape/signal.h - 664 sys sys 944948760 2619
 sys/include/ape/stddef.h - 664 sys sys 944948759 320
-sys/include/ape/stdio.h - 664 sys sys 1046815898 4863
+sys/include/ape/stdio.h - 664 sys sys 1050684342 4950
 sys/include/ape/stdlib.h - 664 sys sys 1038237536 1680
 sys/include/ape/string.h - 664 sys sys 944948760 1212
 sys/include/ape/sys - 20000000775 sys sys 1014927751 0
@@ -3284,7 +3284,7 @@ sys/include/frame.h - 664 sys sys 1014929063 2666
 sys/include/geometry.h - 664 sys sys 1014929063 2632
 sys/include/html.h - 664 sys sys 1017679304 15157
 sys/include/httpd.h - 664 sys sys 1014929064 5726
-sys/include/ip.h - 664 sys sys 1015700847 2395
+sys/include/ip.h - 664 sys sys 1050702405 2908
 sys/include/keyboard.h - 664 sys sys 1014929064 799
 sys/include/libc.h - 664 sys sys 1049426002 18829
 sys/include/libsec.h - 664 sys sys 1048616895 8914
@@ -4882,7 +4882,7 @@ sys/man/8/ping - 664 sys sys 1028233565 2789
 sys/man/8/plan9.ini - 664 sys sys 1040698791 20588
 sys/man/8/pop3 - 664 sys sys 1037397443 2444
 sys/man/8/ppp - 664 sys sys 1050361032 4424
-sys/man/8/prep - 664 sys sys 1018802868 12910
+sys/man/8/prep - 664 sys sys 1050689607 13172
 sys/man/8/qer - 664 sys sys 960837925 4785
 sys/man/8/reboot - 664 sys sys 969499895 414
 sys/man/8/replica - 664 sys sys 1021579979 6239
@@ -5068,7 +5068,7 @@ sys/src/9/ip/ptclbsum.c - 664 sys sys 1022588099 1243
 sys/src/9/ip/rudp.c - 664 sys sys 1047260568 21418
 sys/src/9/ip/tcp.c - 664 sys sys 1047260569 65260
 sys/src/9/ip/tripmedium.c - 664 sys sys 1045063515 7136
-sys/src/9/ip/udp.c - 664 sys sys 1047260569 13089
+sys/src/9/ip/udp.c - 664 sys sys 1050700429 13089
 sys/src/9/mkfile - 664 sys sys 1017795039 191
 sys/src/9/mtx - 20000000775 sys sys 1018721288 0
 sys/src/9/mtx/clock.c - 664 sys sys 1032053278 1293
@@ -5960,16 +5960,18 @@ sys/src/ape/lib/ap/stdio/fputs.c - 664 sys sys 1014921982 137
 sys/src/ape/lib/ap/stdio/fread.c - 664 sys sys 1038237530 667
 sys/src/ape/lib/ap/stdio/freopen.c - 664 sys sys 1033135391 1517
 sys/src/ape/lib/ap/stdio/fscanf.c - 664 sys sys 1014921982 192
-sys/src/ape/lib/ap/stdio/fseek.c - 664 sys sys 1046815860 416
+sys/src/ape/lib/ap/stdio/fseek.c - 664 sys sys 1050684342 411
+sys/src/ape/lib/ap/stdio/fseeko.c - 664 sys sys 1050684342 414
 sys/src/ape/lib/ap/stdio/fsetpos.c - 664 sys sys 1014921982 128
-sys/src/ape/lib/ap/stdio/ftell.c - 664 sys sys 1038237532 317
+sys/src/ape/lib/ap/stdio/ftell.c - 664 sys sys 1050684342 307
+sys/src/ape/lib/ap/stdio/ftello.c - 664 sys sys 1050684342 311
 sys/src/ape/lib/ap/stdio/ftoa.c - 664 sys sys 1014921982 951
 sys/src/ape/lib/ap/stdio/fwrite.c - 664 sys sys 1038237532 909
 sys/src/ape/lib/ap/stdio/getc.c - 664 sys sys 1014921982 99
 sys/src/ape/lib/ap/stdio/getchar.c - 664 sys sys 1014921983 109
 sys/src/ape/lib/ap/stdio/gets.c - 664 sys sys 1014921982 261
 sys/src/ape/lib/ap/stdio/iolib.h - 664 sys sys 1014921982 1442
-sys/src/ape/lib/ap/stdio/mkfile - 664 sys sys 1014921983 805
+sys/src/ape/lib/ap/stdio/mkfile - 664 sys sys 1050684343 829
 sys/src/ape/lib/ap/stdio/perror.c - 664 sys sys 1014921982 236
 sys/src/ape/lib/ap/stdio/pow10.c - 664 sys sys 1014921982 429
 sys/src/ape/lib/ap/stdio/printf.c - 664 sys sys 1014921982 189
@@ -5984,7 +5986,7 @@ sys/src/ape/lib/ap/stdio/scanf.c - 664 sys sys 1014921982 185
 sys/src/ape/lib/ap/stdio/sclose.c - 664 sys sys 1014921982 556
 sys/src/ape/lib/ap/stdio/setbuf.c - 664 sys sys 1014921982 281
 sys/src/ape/lib/ap/stdio/setvbuf.c - 664 sys sys 1014921982 670
-sys/src/ape/lib/ap/stdio/snprintf.c - 664 sys sys 1014921983 304
+sys/src/ape/lib/ap/stdio/snprintf.c - 664 sys sys 1050684385 307
 sys/src/ape/lib/ap/stdio/sopenr.c - 664 sys sys 1014921982 392
 sys/src/ape/lib/ap/stdio/sopenw.c - 664 sys sys 1014921982 287
 sys/src/ape/lib/ap/stdio/sprintf.c - 664 sys sys 1014921982 305
@@ -5998,7 +6000,7 @@ sys/src/ape/lib/ap/stdio/ungetc.c - 664 sys sys 1038237533 491
 sys/src/ape/lib/ap/stdio/vfprintf.c - 664 sys sys 1038237534 14727
 sys/src/ape/lib/ap/stdio/vfscanf.c - 664 sys sys 1014921983 9100
 sys/src/ape/lib/ap/stdio/vprintf.c - 664 sys sys 1014921983 134
-sys/src/ape/lib/ap/stdio/vsnprintf.c - 664 sys sys 1014921983 274
+sys/src/ape/lib/ap/stdio/vsnprintf.c - 664 sys sys 1050684390 277
 sys/src/ape/lib/ap/stdio/vsprintf.c - 664 sys sys 1014921983 266
 sys/src/ape/lib/ap/syscall - 20000000775 sys sys 1014921991 0
 sys/src/ape/lib/ap/syscall/mkfile - 664 sys sys 1038322304 2498
@@ -6447,8 +6449,8 @@ sys/src/cmd/9nfs/chat.c - 664 sys sys 1017337813 2096
 sys/src/cmd/9nfs/dat.h - 664 sys sys 1017337813 4445
 sys/src/cmd/9nfs/fns.h - 664 sys sys 1017337813 1879
 sys/src/cmd/9nfs/listalloc.c - 664 sys sys 1015090372 297
-sys/src/cmd/9nfs/mkfile - 664 sys sys 1034737140 648
-sys/src/cmd/9nfs/mport.c - 664 sys sys 1017337814 3749
+sys/src/cmd/9nfs/mkfile - 664 sys sys 1050715042 621
+sys/src/cmd/9nfs/mport.c - 664 sys sys 1050715069 3779
 sys/src/cmd/9nfs/nametest.c - 664 sys sys 1015090372 1723
 sys/src/cmd/9nfs/nfs.c - 664 sys sys 1017337814 9508
 sys/src/cmd/9nfs/nfs.h - 664 sys sys 1015090372 642
@@ -6458,7 +6460,7 @@ sys/src/cmd/9nfs/pcnfsd.c - 664 sys sys 1017337815 3964
 sys/src/cmd/9nfs/portmapper.c - 664 sys sys 1040952456 3179
 sys/src/cmd/9nfs/rpc.c - 664 sys sys 1017337815 5293
 sys/src/cmd/9nfs/rpc.h - 664 sys sys 1017337815 1996
-sys/src/cmd/9nfs/server.c - 664 sys sys 1040952456 11027
+sys/src/cmd/9nfs/server.c - 664 sys sys 1050715043 11065
 sys/src/cmd/9nfs/string.c - 664 sys sys 1017337815 1659
 sys/src/cmd/9nfs/strparse.c - 664 sys sys 1015090373 506
 sys/src/cmd/9nfs/system.c - 664 sys sys 1017337815 437
@@ -6487,7 +6489,7 @@ sys/src/cmd/acme/buff.c - 664 sys sys 1014926092 5573
 sys/src/cmd/acme/cols.c - 664 sys sys 1032462024 11122
 sys/src/cmd/acme/dat.h - 664 sys sys 1045504837 10938
 sys/src/cmd/acme/disk.c - 664 sys sys 1014926093 2151
-sys/src/cmd/acme/ecmd.c - 664 sys sys 1045504838 23562
+sys/src/cmd/acme/ecmd.c - 664 sys sys 1050686429 23681
 sys/src/cmd/acme/edit.c - 664 sys sys 1015701171 12055
 sys/src/cmd/acme/edit.h - 664 sys sys 969500816 2466
 sys/src/cmd/acme/elog.c - 664 sys sys 1045504839 6830
@@ -6688,7 +6690,7 @@ sys/src/cmd/aux/rdwr.c - 664 sys sys 1016833876 811
 sys/src/cmd/aux/reboot.c - 664 sys sys 1014925091 1411
 sys/src/cmd/aux/searchfs.c - 664 sys sys 1014925091 18176
 sys/src/cmd/aux/stub.c - 664 sys sys 1032468954 2637
-sys/src/cmd/aux/timesync.c - 664 sys sys 1047751422 24211
+sys/src/cmd/aux/timesync.c - 664 sys sys 1050714588 24242
 sys/src/cmd/aux/trampoline.c - 664 sys sys 1034780422 3571
 sys/src/cmd/aux/typepasswd.c - 664 sys sys 1014925091 1761
 sys/src/cmd/aux/unlock - 664 sys sys 944960793 0
@@ -7016,7 +7018,7 @@ sys/src/cmd/disk/prep - 20000000775 sys sys 988249968 0
 sys/src/cmd/disk/prep/calc.y - 664 sys sys 958519682 2378
 sys/src/cmd/disk/prep/edit.c - 664 sys sys 1017854327 9714
 sys/src/cmd/disk/prep/edit.h - 664 sys sys 1015009215 994
-sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1048796732 21876
+sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1050689604 21894
 sys/src/cmd/disk/prep/mkfile - 664 sys sys 1022450200 250
 sys/src/cmd/disk/prep/prep.c - 664 sys sys 1015009215 8976
 sys/src/cmd/disk/rd9660.c - 664 sys sys 1021579990 7446
@@ -8952,7 +8954,7 @@ sys/src/cmd/gzip/gunzip.c - 664 sys sys 1014924864 6039
 sys/src/cmd/gzip/gzip.c - 664 sys sys 1014924864 3646
 sys/src/cmd/gzip/gzip.h - 664 sys sys 954778718 1058
 sys/src/cmd/gzip/mkfile - 664 sys sys 984758036 125
-sys/src/cmd/gzip/unzip.c - 664 sys sys 1045505170 13605
+sys/src/cmd/gzip/unzip.c - 664 sys sys 1050689595 13603
 sys/src/cmd/gzip/zip.c - 664 sys sys 1033183074 7054
 sys/src/cmd/gzip/zip.h - 664 sys sys 954778719 1428
 sys/src/cmd/hget.c - 664 sys sys 1045015305 21966
@@ -8986,13 +8988,13 @@ sys/src/cmd/ip - 20000000775 sys sys 1015096228 0
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
 sys/src/cmd/ip/bootp.h - 664 sys sys 944961013 789
 sys/src/cmd/ip/dhcp.h - 664 sys sys 984788891 3367
-sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1015013111 11946
+sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1050714660 11978
 sys/src/cmd/ip/dhcpd - 20000000775 sys sys 988249979 0
 sys/src/cmd/ip/dhcpd/dat.h - 664 sys sys 1032655000 2503
 sys/src/cmd/ip/dhcpd/db.c - 664 sys sys 1032655001 7484
-sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1032611011 32733
+sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1050714684 32770
 sys/src/cmd/ip/dhcpd/dhcpleases.c - 664 sys sys 1032655001 779
-sys/src/cmd/ip/dhcpd/mkfile - 664 sys sys 1032657376 449
+sys/src/cmd/ip/dhcpd/mkfile - 664 sys sys 1050714681 423
 sys/src/cmd/ip/dhcpd/ndb.c - 664 sys sys 1032611012 6058
 sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 956275654 1881
 sys/src/cmd/ip/dhcpd/testlook.c - 664 sys sys 950389140 4640
@@ -9048,7 +9050,7 @@ sys/src/cmd/ip/imap4d/nodes.c - 664 sys sys 1015013077 3173
 sys/src/cmd/ip/imap4d/search.c - 664 sys sys 1015013077 4520
 sys/src/cmd/ip/imap4d/store.c - 664 sys sys 1015013077 1910
 sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1015013077 2481
-sys/src/cmd/ip/ipconfig.c - 664 sys sys 1032611222 27863
+sys/src/cmd/ip/ipconfig.c - 664 sys sys 1050714671 27099
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1038443023 1222
 sys/src/cmd/ip/ping.c - 664 sys sys 1032059854 5046
@@ -9110,7 +9112,7 @@ sys/src/cmd/ip/telnet.h - 664 sys sys 1015090250 5902
 sys/src/cmd/ip/telnetd.c - 664 sys sys 1032060109 11731
 sys/src/cmd/ip/tftpd.c - 664 sys sys 1015013113 7136
 sys/src/cmd/ip/traceroute.c - 664 sys sys 1032060124 9370
-sys/src/cmd/ip/udpecho.c - 664 sys sys 952201346 827
+sys/src/cmd/ip/udpecho.c - 664 sys sys 1050714674 855
 sys/src/cmd/join.c - 664 sys sys 944961364 7488
 sys/src/cmd/jpg - 20000000775 sys sys 988249983 0
 sys/src/cmd/jpg/close.c - 664 sys sys 944961292 1930
@@ -9305,20 +9307,20 @@ sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
 sys/src/cmd/mv.c - 664 sys sys 1014926695 4276
 sys/src/cmd/ndb - 20000000775 sys sys 988249988 0
 sys/src/cmd/ndb/convDNS2M.c - 664 sys sys 1021579991 6525
-sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1021579992 6684
+sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1050714836 6740
 sys/src/cmd/ndb/cs.c - 664 sys sys 1049249331 32741
 sys/src/cmd/ndb/csgetval.c - 664 sys sys 957402051 1051
 sys/src/cmd/ndb/csquery.c - 664 sys sys 1014926159 1062
 sys/src/cmd/ndb/dblookup.c - 664 sys sys 1049249333 18409
 sys/src/cmd/ndb/dn.c - 664 sys sys 1049408473 25198
-sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1049249333 15279
+sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1050714836 15288
 sys/src/cmd/ndb/dns.c - 664 sys sys 1049249331 15051
 sys/src/cmd/ndb/dns.h - 664 sys sys 1032060499 8082
 sys/src/cmd/ndb/dnsdebug.c - 664 sys sys 1049249332 8333
 sys/src/cmd/ndb/dnserver.c - 664 sys sys 1021579994 3687
 sys/src/cmd/ndb/dnsquery.c - 664 sys sys 1014926160 2108
 sys/src/cmd/ndb/dnstcp.c - 664 sys sys 1024158822 7040
-sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1024158821 5050
+sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1050714835 5133
 sys/src/cmd/ndb/ipquery.c - 664 sys sys 960335375 760
 sys/src/cmd/ndb/mkdb.c - 664 sys sys 957402054 2886
 sys/src/cmd/ndb/mkfile - 664 sys sys 1049249334 1835
@@ -9672,7 +9674,7 @@ sys/src/cmd/postscript/trofftable/trofftable.mk - 664 sys sys 944961073 1852
 sys/src/cmd/postscript/trofftable/trofftable.ps - 664 sys sys 944961073 3678
 sys/src/cmd/postscript/trofftable/trofftable.rc - 664 sys sys 984789206 2637
 sys/src/cmd/postscript/trofftable/trofftable.sh - 664 sys sys 984789206 2613
-sys/src/cmd/pr.c - 664 sys sys 1015013203 11158
+sys/src/cmd/pr.c - 664 sys sys 1050689592 11172
 sys/src/cmd/primes.c - 664 sys sys 944961351 2126
 sys/src/cmd/prof.c - 664 sys sys 1014926696 5186
 sys/src/cmd/proof - 20000000775 sys sys 944961622 0
@@ -11795,7 +11797,7 @@ sys/src/libsunrpc/prog.c - 664 sys sys 1046367120 1704
 sys/src/libsunrpc/rpc.c - 664 sys sys 1045589225 9235
 sys/src/libsunrpc/server.c - 664 sys sys 1048645438 5237
 sys/src/libsunrpc/suncall.c - 664 sys sys 1046367121 257
-sys/src/libsunrpc/udp.c - 664 sys sys 1048645439 2161
+sys/src/libsunrpc/udp.c - 664 sys sys 1050717777 2193
 sys/src/libthread - 20000000775 sys sys 1014928161 0
 sys/src/libthread/386.c - 664 sys sys 1014928156 448
 sys/src/libthread/alpha.c - 664 sys sys 1014928156 664

+ 43 - 0
dist/replica/plan9.log

@@ -19128,3 +19128,46 @@
 1050585083 0 c 386/bin/nfs - 775 sys sys 1050585060 317019
 1050585083 1 c 386/lib/lib9p.a - 664 sys sys 1050585062 80292
 1050624118 0 c sys/doc/fossil.ms - 664 sys sys 1050623502 31400
+1050685282 0 c 386/lib/ape/libap.a - 664 sys sys 1050684345 796804
+1050685282 1 c sys/include/ape/stdio.h - 664 sys sys 1050684342 4950
+1050685282 2 c sys/src/ape/lib/ap/stdio/fseek.c - 664 sys sys 1050684342 411
+1050685282 3 a sys/src/ape/lib/ap/stdio/fseeko.c - 664 sys sys 1050684342 414
+1050685282 4 c sys/src/ape/lib/ap/stdio/ftell.c - 664 sys sys 1050684342 307
+1050685282 5 a sys/src/ape/lib/ap/stdio/ftello.c - 664 sys sys 1050684342 311
+1050685282 6 c sys/src/ape/lib/ap/stdio/mkfile - 664 sys sys 1050684343 829
+1050685282 7 c sys/src/ape/lib/ap/stdio/snprintf.c - 664 sys sys 1050684385 307
+1050685282 8 c sys/src/ape/lib/ap/stdio/vsnprintf.c - 664 sys sys 1050684390 277
+1050687084 0 c sys/src/cmd/acme/ecmd.c - 664 sys sys 1050686429 23681
+1050690689 0 c sys/man/8/prep - 664 sys sys 1050689607 13172
+1050690689 1 c sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1050689604 21894
+1050690689 2 c sys/src/cmd/gzip/unzip.c - 664 sys sys 1050689595 13603
+1050690689 3 c sys/src/cmd/pr.c - 664 sys sys 1050689592 11172
+1050697896 0 c sys/include/ip.h - 664 sys sys 1050697330 2523
+1050697896 1 c sys/src/9/ip/udp.c - 664 sys sys 1050697278 13227
+1050699698 0 c sys/include/ip.h - 664 sys sys 1050698306 2914
+1050699698 1 c sys/src/9/ip/udp.c - 664 sys sys 1050698315 13073
+1050701500 0 c sys/include/ip.h - 664 sys sys 1050700486 2395
+1050701500 1 c sys/src/9/ip/udp.c - 664 sys sys 1050700429 13089
+1050703302 0 c sys/include/ip.h - 664 sys sys 1050702405 2908
+1050715915 0 c 386/bin/aux/nfsserver - 775 sys sys 1050715127 171093
+1050715915 1 c 386/bin/aux/pcnfsd - 775 sys sys 1050715126 126789
+1050715915 2 c 386/bin/aux/portmapper - 775 sys sys 1050715127 125677
+1050715915 3 c 386/bin/aux/timesync - 775 sys sys 1050714589 127691
+1050715915 4 c 386/bin/ip/dhcpclient - 775 sys sys 1050714751 92362
+1050715915 5 c 386/bin/ip/ipconfig - 775 sys sys 1050714743 102456
+1050715915 6 c 386/bin/ip/udpecho - 775 sys sys 1050714732 43574
+1050715915 7 c 386/bin/ndb/dns - 775 sys sys 1050714846 211399
+1050715915 8 c 386/bin/ndb/dnsdebug - 775 sys sys 1050714853 186310
+1050715915 9 c sys/src/cmd/9nfs/mkfile - 664 sys sys 1050715042 621
+1050715915 10 c sys/src/cmd/9nfs/mport.c - 664 sys sys 1050715069 3779
+1050715915 11 c sys/src/cmd/9nfs/server.c - 664 sys sys 1050715043 11065
+1050715915 12 c sys/src/cmd/aux/timesync.c - 664 sys sys 1050714588 24242
+1050715915 13 c sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1050714660 11978
+1050715915 14 c sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1050714684 32770
+1050715915 15 c sys/src/cmd/ip/dhcpd/mkfile - 664 sys sys 1050714681 423
+1050715915 16 c sys/src/cmd/ip/ipconfig.c - 664 sys sys 1050714671 27099
+1050715915 17 c sys/src/cmd/ip/udpecho.c - 664 sys sys 1050714674 855
+1050715915 18 c sys/src/cmd/ndb/convM2DNS.c - 664 sys sys 1050714836 6740
+1050715915 19 c sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1050714836 15288
+1050715915 20 c sys/src/cmd/ndb/dnudpserver.c - 664 sys sys 1050714835 5133
+1050717717 0 c sys/src/libsunrpc/udp.c - 664 sys sys 1050717777 2193

+ 7 - 4
sys/include/ape/stdio.h

@@ -7,6 +7,7 @@
  */
 #include <stdarg.h>
 #include <stddef.h>
+#include <sys/types.h>
 /*
  * According to X3J11, there is only one i/o buffer
  * and it must not be occupied by both input and output data.
@@ -83,12 +84,12 @@ extern int fscanf(FILE *, const char *, ...);
 extern int printf(const char *, ...);
 extern int scanf(const char *, ...);
 extern int sprintf(char *, const char *, ...);
-extern int snprintf(char *, int, const char *, ...);
+extern int snprintf(char *, size_t, const char *, ...);
 extern int sscanf(const char *, const char *, ...);
 extern int vfprintf(FILE *, const char *, va_list);
 extern int vprintf(const char *, va_list);
 extern int vsprintf(char *, const char *, va_list);
-extern int vsnprintf(char *, int, const char *, va_list);
+extern int vsnprintf(char *, size_t, const char *, va_list);
 extern int vfscanf(FILE *, const char *, va_list);
 extern int fgetc(FILE *);
 extern char *fgets(char *, int, FILE *);
@@ -110,9 +111,11 @@ extern int ungetc(int, FILE *);
 extern size_t fread(void *, size_t, size_t, FILE *);
 extern size_t fwrite(const void *, size_t, size_t, FILE *);
 extern int fgetpos(FILE *, fpos_t *);
-extern int fseek(FILE *, long long, int);
+extern int fseek(FILE *, long, int);
+extern int fseeko(FILE *, off_t, int);
 extern int fsetpos(FILE *, const fpos_t *);
-extern long long ftell(FILE *);
+extern long ftell(FILE *);
+extern off_t ftello(FILE *);
 extern void rewind(FILE *);
 extern void clearerr(FILE *);
 extern int feof(FILE *);

+ 24 - 4
sys/include/ip.h

@@ -63,15 +63,16 @@ struct Ipifc
 };
 
 /*
- *  user level udp headers
+ *  user level udp headers with cntrol message "oldheaders".
+ *  this is now considered obsolete.
  */
 enum 
 {
-	Udphdrsize=	36,	/* size of a Udphdr */
+	OUdphdrsize=	36,	/* size of a OUdphdr */
 };
 
-typedef struct Udphdr Udphdr;
-struct Udphdr
+typedef struct OUdphdr OUdphdr;
+struct OUdphdr
 {
 	uchar	raddr[IPaddrlen];	/* remote address and port */
 	uchar	laddr[IPaddrlen];	/* local address and port */
@@ -79,6 +80,25 @@ struct Udphdr
 	uchar	lport[2];
 };
 
+/*
+ *  user level udp headers with cntrol message "headers"
+ */
+enum 
+{
+	Udphdrsize=	52,	/* size of a Udphdr */
+};
+
+typedef struct Udphdr Udphdr;
+struct Udphdr
+{
+	uchar	raddr[IPaddrlen];	/* remote address */
+	uchar	laddr[IPaddrlen];	/* local address */
+	uchar	ifcaddr[IPaddrlen];	/* address of ifc message was received from
+					   (only useful on reception) */
+	uchar	rport[2];		/* remove port */
+	uchar	lport[2];		/* local port */
+};
+
 uchar*	defmask(uchar*);
 void	maskip(uchar*, uchar*, uchar*);
 int	eipfmt(Fmt*);

+ 13 - 1
sys/man/8/prep

@@ -296,6 +296,13 @@ are omitted,
 and
 .I fdisk
 will prompt for them.
+In
+.IR fdisk ,
+the newly created partition has type
+.RB `` PLAN9 ;''
+to set a different type, use the
+.B t
+command (q.v.).
 .I Start
 and
 .I end
@@ -415,7 +422,7 @@ again will quit the program.
 .I Fdisk
 also has the following commands.
 .TP
-.BI A " name"
+.BI A " name
 Set the named partition active.
 The active partition is the one whose boot block is used
 when booting a PC from disk.
@@ -423,6 +430,11 @@ when booting a PC from disk.
 .B e
 Print the names of empty slots in the partition table, i.e., the
 valid names to use when creating a new partition.
+.TP
+.BI t " \fR[\fI type \fR]
+Set the partition type.  If it is not given, 
+.I fdisk
+will display a list of choices and then prompt for it.
 .PD
 .PP
 .I Format

+ 1 - 1
sys/src/ape/lib/ap/stdio/fseek.c

@@ -2,7 +2,7 @@
  * pANS stdio -- fseek
  */
 #include "iolib.h"
-int fseek(FILE *f, long long offs, int type){
+int fseek(FILE *f, long offs, int type){
 	switch(f->state){
 	case ERR:
 	case CLOSED:

+ 24 - 0
sys/src/ape/lib/ap/stdio/fseeko.c

@@ -0,0 +1,24 @@
+/*
+ * pANS stdio -- fseeko
+ */
+#include "iolib.h"
+int fseeko(FILE *f, off_t offs, int type){
+	switch(f->state){
+	case ERR:
+	case CLOSED:
+		return -1;
+	case WR:
+		fflush(f);
+		break;
+	case RD:
+		if(type==1 && f->buf!=f->unbuf)
+			offs-=f->wp-f->rp;
+		break;
+	}
+	if(f->flags&STRING || lseek(f->fd, offs, type)==-1)
+		return -1;
+	if(f->state==RD) f->rp=f->wp=f->buf;
+	if(f->state!=OPEN)
+		f->state=RDWR;
+	return 0;
+}

+ 2 - 2
sys/src/ape/lib/ap/stdio/ftell.c

@@ -2,8 +2,8 @@
  * pANS stdio -- ftell
  */
 #include "iolib.h"
-long long ftell(FILE *f){
-	long long seekp=lseek(f->fd, 0L, 1);
+long ftell(FILE *f){
+	long seekp=lseek(f->fd, 0L, 1);
 	if(seekp<0) return -1;		/* enter error state? */
 	switch(f->state){
 	default:

+ 16 - 0
sys/src/ape/lib/ap/stdio/ftello.c

@@ -0,0 +1,16 @@
+/*
+ * pANS stdio -- ftello
+ */
+#include "iolib.h"
+off_t ftello(FILE *f){
+	off_t seekp=lseek(f->fd, 0L, 1);
+	if(seekp<0) return -1;		/* enter error state? */
+	switch(f->state){
+	default:
+		return seekp;
+	case RD:
+		return seekp-(f->wp-f->rp);
+	case WR:
+		return (f->flags&LINEBUF?f->lp:f->wp)-f->buf+seekp;
+	}
+}

+ 2 - 0
sys/src/ape/lib/ap/stdio/mkfile

@@ -25,8 +25,10 @@ OFILES=\
 	freopen.$O\
 	fscanf.$O\
 	fseek.$O\
+	fseeko.$O\
 	fsetpos.$O\
 	ftell.$O\
+	ftello.$O\
 	ftoa.$O\
 	fwrite.$O\
 	getc.$O\

+ 1 - 1
sys/src/ape/lib/ap/stdio/snprintf.c

@@ -2,7 +2,7 @@
  * pANS stdio -- sprintf
  */
 #include "iolib.h"
-int snprintf(char *buf, int nbuf, const char *fmt, ...){
+int snprintf(char *buf, size_t nbuf, const char *fmt, ...){
 	int n;
 	va_list args;
 	FILE *f=_IO_sopenw();

+ 1 - 1
sys/src/ape/lib/ap/stdio/vsnprintf.c

@@ -2,7 +2,7 @@
  * pANS stdio -- vsnprintf
  */
 #include "iolib.h"
-int vsnprintf(char *buf, int nbuf, const char *fmt, va_list args){
+int vsnprintf(char *buf, size_t nbuf, const char *fmt, va_list args){
 	int n;
 	char *v;
 	FILE *f=_IO_sopenw();

+ 0 - 1
sys/src/cmd/9nfs/mkfile

@@ -36,7 +36,6 @@ UPDATE=\
 	${OFILES:%.$O=%.c}\
 	${NFSSERVER:%.$O=%.c}\
 	${TARG:%=%.c}\
-	${TARG:%=/386/bin/aux/%}\
 
 </sys/src/cmd/mkmany
 

+ 1 - 0
sys/src/cmd/9nfs/mport.c

@@ -50,6 +50,7 @@ main(int argc, char **argv)
 		fprint(2, "can't set header mode: %r\n");
 		exits("headers");
 	}
+	fprint(r.ctl, "oldheaders");
 	sprint(name, "%s/remote", dir);
 	fd = open(name, OREAD);
 	if(fd < 0){

+ 9 - 8
sys/src/cmd/9nfs/server.c

@@ -10,7 +10,7 @@ static void	cachereply(Rpccall*, void*, int);
 static int	replycache(int, Rpccall*, long (*)(int, void*, long));
 static void	udpserver(int, Progmap*);
 static void	tcpserver(int, Progmap*);
-static void	getendpoints(Udphdr*, char*);
+static void	getendpoints(OUdphdr*, char*);
 static long	readtcp(int, void*, long);
 static long	writetcp(int, void*, long);
 static int	servemsg(int, long (*)(int, void*, long), long (*)(int, void*, long),
@@ -98,6 +98,7 @@ udpserver(int myport, Progmap *progmap)
 		panic("can't announce %s: %r\n", service);
 	if(fprint(ctlfd, "headers") < 0)
 		panic("can't set header mode: %r\n");
+	fprint(ctlfd, "oldheaders");
 
 	snprint(data, sizeof data, "%s/data", devdir);
 
@@ -155,7 +156,7 @@ tcpserver(int myport, Progmap *progmap)
 			if(data < 0)
 				exits(0);
 	
-			getendpoints((Udphdr*)buf, ldir);
+			getendpoints((OUdphdr*)buf, ldir);
 	
 			for(;;){
 				if(servemsg(data, readtcp, writetcp, myport, progmap) < 0)
@@ -315,7 +316,7 @@ getendpoint(char *dir, char *file, uchar *addr, uchar *port)
 }
 	
 static void
-getendpoints(Udphdr *ep, char *dir)
+getendpoints(OUdphdr *ep, char *dir)
 {
 	getendpoint(dir, "local", ep->laddr, ep->lport);
 	getendpoint(dir, "remote", ep->raddr, ep->rport);
@@ -330,8 +331,8 @@ readtcp(int fd, void *vbuf, long blen)
 	char *buf;
 
 	buf = vbuf;
-	buf += Udphdrsize;
-	blen -= Udphdrsize;
+	buf += OUdphdrsize;
+	blen -= OUdphdrsize;
 
 	done = 0;
 	for(sofar = 0; !done; sofar += n){
@@ -347,7 +348,7 @@ readtcp(int fd, void *vbuf, long blen)
 		if(m != n)
 			return 0;
 	}
-	return sofar + Udphdrsize;
+	return sofar + OUdphdrsize;
 }
 
 static long
@@ -356,8 +357,8 @@ writetcp(int fd, void *vbuf, long len)
 	char *buf;
 
 	buf = vbuf;
-	buf += Udphdrsize;
-	len -= Udphdrsize;
+	buf += OUdphdrsize;
+	len -= OUdphdrsize;
 
 	buf -= 4;
 	buf[0] = 0x80 | (len>>24);

+ 9 - 1
sys/src/cmd/acme/ecmd.c

@@ -345,8 +345,16 @@ int
 f_cmd(Text *t, Cmd *cp)
 {
 	Rune *name;
+	String *str;
+	String empty;
 
-	name = cmdname(t->file, cp->text, TRUE);
+	if(cp->text == nil){
+		empty.n = 0;
+		empty.r = L"";
+		str = &empty;
+	}else
+		str = cp->text;
+	name = cmdname(t->file, str, TRUE);
 	free(name);
 	pfilename(t->file);
 	return TRUE;

+ 4 - 3
sys/src/cmd/aux/timesync.c

@@ -1057,6 +1057,7 @@ openlisten(char *net)
 		sysfatal("can't announce");
 	if(fprint(cfd, "headers") < 0)
 		sysfatal("can't set header mode");
+	fprint(cfd, "oldheaders");
 
 	sprint(data, "%s/data", devdir);
 
@@ -1099,10 +1100,10 @@ ntpserver(char *servenet)
 		gettime(&recvts, 0, 0);
 		if(n < 0)
 			return;
-		if(n < Udphdrsize + NTPSIZE)
+		if(n < OUdphdrsize + NTPSIZE)
 			continue;
 
-		ntp = (NTPpkt*)(buf+Udphdrsize);
+		ntp = (NTPpkt*)(buf+OUdphdrsize);
 		mode = ntp->mode & 7;
 		vers = (ntp->mode>>3) & 7;
 		if(mode != 3)
@@ -1117,7 +1118,7 @@ ntpserver(char *servenet)
 		memmove(ntp->rootid, rootid, sizeof(ntp->rootid));
 		gettime(&x, 0, 0);
 		hnputts(ntp->xmitts, x);
-		write(fd, buf, NTPSIZE+Udphdrsize);
+		write(fd, buf, NTPSIZE+OUdphdrsize);
 	}
 }
 

+ 1 - 0
sys/src/cmd/disk/prep/fdisk.c

@@ -793,6 +793,7 @@ cmdadd(Edit *edit, char *name, vlong start, vlong end)
 		start += edit->disk->s;
 	p = mkpart(name, name[0]=='p', start, end-start, nil);
 	p->changed = 1;
+	p->type = Type9;
 	return addpart(edit, p);
 }
 

+ 2 - 1
sys/src/cmd/gzip/unzip.c

@@ -371,7 +371,8 @@ unzipEntry(Biobuf *bin, ZipHead *czh)
 			isdir = czh->eattr & ZDDir;
 			if(isdir && zh.uncsize != 0)
 				fprint(2, "unzip: ignoring directory data for %s\n", zh.file);
-		}else if(zh.meth == 0 && zh.uncsize == 0){
+		}
+		if(zh.meth == 0 && zh.uncsize == 0){
 			p = strchr(zh.file, '\0');
 			if(p > zh.file && p[-1] == '/')
 				isdir = 1;

+ 5 - 4
sys/src/cmd/ip/dhcpclient.c

@@ -220,12 +220,12 @@ void
 dhcpsend(int type)
 {
 	Bootp bp;
-	Udphdr *up;
+	OUdphdr *up;
 	uchar *p;
 	int n;
 
 	memset(&bp, 0, sizeof(bp));
-	up = (Udphdr*)bp.udphdr;
+	up = (OUdphdr*)bp.udphdr;
 
 	hnputs(up->rport, 67);
 	bp.op = Bootrequest;
@@ -369,6 +369,7 @@ openlisten(char *net)
 
 	if(fprint(cfd, "headers") < 0)
 		myfatal("can't set header mode: %r");
+	fprint(cfd, "oldheaders");
 
 	sprint(data, "%s/data", devdir);
 
@@ -543,11 +544,11 @@ void
 bootpdump(uchar *p, int n)
 {
 	Bootp *bp;
-	Udphdr *up;
+	OUdphdr *up;
 	int len, i, code;
 
 	bp = (Bootp*)p;
-	up = (Udphdr*)bp->udphdr;
+	up = (OUdphdr*)bp->udphdr;
 
 	if(n < bp->optmagic - p) {
 		fprint(2, "dhcpclient: short bootp packet");

+ 10 - 9
sys/src/cmd/ip/dhcpd/dhcpd.c

@@ -14,7 +14,7 @@ struct Req
 {
 	int	fd;			/* for reply */
 	Bootp	*bp;
-	Udphdr	*up;
+	OUdphdr	*up;
 	uchar	*e;			/* end of received message */
 	uchar	*p;			/* options pointer */
 	uchar	*max;			/* max end of reply */
@@ -293,7 +293,7 @@ main(int argc, char **argv)
 		memset(&r, 0, sizeof(r));
 		r.fd = fd;
 		n = readlast(r.fd, r.buf, sizeof(r.buf));
-		if(n < Udphdrsize)
+		if(n < OUdphdrsize)
 			fatal(1, "error reading requests");
 		start = nsec()/1000;
 		op = optbuf;
@@ -314,8 +314,8 @@ proto(Req *rp, int n)
 
 	rp->e = rp->buf + n;
 	rp->bp = (Bootp*)rp->buf;
-	rp->up = (Udphdr*)rp->buf;
-	rp->max = rp->buf + Udphdrsize + MINSUPPORTED - IPUDPHDRSIZE;
+	rp->up = (OUdphdr*)rp->buf;
+	rp->max = rp->buf + OUdphdrsize + MINSUPPORTED - IPUDPHDRSIZE;
 	rp->p = rp->bp->optdata;
 	v4tov6(rp->giaddr, rp->bp->giaddr);
 	v4tov6(rp->ciaddr, rp->bp->ciaddr);
@@ -690,7 +690,7 @@ sendoffer(Req *rp, uchar *ip, int offer)
 	int n;
 	ushort flags;
 	Bootp *bp;
-	Udphdr *up;
+	OUdphdr *up;
 
 	bp = rp->bp;
 	up = rp->up;
@@ -750,7 +750,7 @@ sendack(Req *rp, uchar *ip, int offer, int sendlease)
 	int n;
 	ushort flags;
 	Bootp *bp;
-	Udphdr *up;
+	OUdphdr *up;
 
 	bp = rp->bp;
 	up = rp->up;
@@ -810,7 +810,7 @@ sendnak(Req *rp, char *msg)
 {
 	int n;
 	Bootp *bp;
-	Udphdr *up;
+	OUdphdr *up;
 
 	bp = rp->bp;
 	up = rp->up;
@@ -863,7 +863,7 @@ bootp(Req *rp)
 {
 	int n;
 	Bootp *bp;
-	Udphdr *up;
+	OUdphdr *up;
 	ushort flags;
 	Iplifc *lifc;
 	Info *iip;
@@ -1048,7 +1048,7 @@ parseoptions(Req *rp)
 		case ODmaxmsg:
 			c = nhgets(o);
 			c -= 28;
-			c += Udphdrsize;
+			c += OUdphdrsize;
 			if(c > 0)
 				rp->max = rp->buf + c;
 			break;
@@ -1254,6 +1254,7 @@ openlisten(char *net)
 		fatal(1, "can't announce");
 	if(fprint(cfd, "headers") < 0)
 		fatal(1, "can't set header mode");
+	fprint(cfd, "oldheaders");
 
 	sprint(data, "%s/data", devdir);
 

+ 0 - 1
sys/src/cmd/ip/dhcpd/mkfile

@@ -23,7 +23,6 @@ UPDATE=\
 	$HFILES\
 	${DOFILES:%.$O=%.c}\
 	${IOFILES:%.$O=%.c}\
-	${TARG:%=/386/bin/ip/%}\
 
 </sys/src/cmd/mkmany
 

+ 78 - 115
sys/src/cmd/ip/ipconfig.c

@@ -9,6 +9,9 @@ int	dodhcp;
 int	nip;
 int	myifc = -1;
 int	plan9 = 1;
+int	beprimary;
+int	nodhcpwatch;
+
 Ipifc	*ifc;
 
 // possible verbs
@@ -16,7 +19,8 @@ enum
 {
 	Vadd,
 	Vremove,
-	Vunbind
+	Vunbind,
+	Vether,
 };
 
 struct {
@@ -115,7 +119,7 @@ Ctl *firstctl, **ctll;
 void
 usage(void)
 {
-	fprint(2, "usage: %s [-ndDrG] [-x netmtpt] [-m mtu] [-b baud] [-g gateway] [-h hostname] [-c control-string]* type device [verb] [localaddr [mask [remoteaddr [fsaddr [authaddr]]]]]\n", argv0);
+	fprint(2, "usage: %s [-ndDrGX] [-x netmtpt] [-m mtu] [-b baud] [-g gateway] [-h hostname] [-c control-string]* type device [verb] [localaddr [mask [remoteaddr [fsaddr [authaddr]]]]]\n", argv0);
 	exits("usage");
 }
 
@@ -123,7 +127,7 @@ void
 main(int argc, char **argv)
 {
 	char *p;
-	int retry, verb;
+	int retry, verb, action;
 	Ctl *cp;
 
 	srand(truerand());
@@ -141,6 +145,21 @@ main(int argc, char **argv)
 	ctll = &firstctl;
 
 	ARGBEGIN {
+	case 'D':
+		debug = 1;
+		break;
+	case 'G':
+		plan9 = 0;
+		break;
+	case 'P':
+		beprimary = 1;
+		break;
+	case 'b':
+		p = ARGF();
+		if(p == nil)
+			usage();
+		conf.baud = p;
+		break;
 	case 'c':
 		p = ARGF();
 		if(p == nil)
@@ -153,12 +172,15 @@ main(int argc, char **argv)
 		cp->next = nil;
 		cp->ctl = p;
 		break;
-	case 'D':
-		debug = 1;
-		break;
 	case 'd':
 		dodhcp = 1;
 		break;
+	case 'g':
+		p = ARGF();
+		if(p == nil)
+			usage();
+		parseip(conf.gaddr, p);
+		break;
 	case 'h':
 		p = ARGF();
 		if(p == nil)
@@ -174,66 +196,45 @@ main(int argc, char **argv)
 			usage();
 		conf.mtu = atoi(p);
 		break;
+	case 'r':
+		retry = 1;
+		break;
 	case 'x':
 		p = ARGF();
 		if(p == nil)
 			usage();
 		setnetmtpt(conf.mpoint, sizeof(conf.mpoint), p);
 		break;
-	case 'g':
-		p = ARGF();
-		if(p == nil)
-			usage();
-		parseip(conf.gaddr, p);
-		break;
-	case 'b':
-		p = ARGF();
-		if(p == nil)
-			usage();
-		conf.baud = p;
-		break;
-	case 'r':
-		retry = 1;
-		break;
-	case 'G':
-		plan9 = 0;
+	case 'X':
+		nodhcpwatch = 1;
 		break;
 	} ARGEND;
 
-	// get medium, default is ether
-	switch(argc){
-	default:
-		conf.dev = argv[1];
-		conf.type = argv[0];
-		argc -= 2;
-		argv += 2;
-		break;
-	case 1:
-		conf.type = argv[0];
-		if(strcmp(conf.type, "ether") == 0)
-			conf.dev = "/net/ether0";
-		else if(strcmp(conf.type, "ppp") == 0)
-			conf.dev = "/dev/eia0";
-		else
-			usage();
-		argc -= 1;
-		argv += 1;
-		break;
-	case 0:
-		conf.type = "ether";
-		conf.dev = "/net/ether0";
-		break;
-	}
+	// default
+	conf.type = "ether";
+	conf.dev = "/net/ether0";
+	action = Vadd;
 
 	// get verb, default is "add"
-	verb = Vadd;
-	if(argc > 0){
+	while(argc > 0){
 		verb = parseverb(argv[0]);
-		if(verb >= 0){
-			argc--;
-			argv++;
-		} else
-			verb = Vadd;
+		switch(verb){
+		case Vadd:
+		case Vremove:
+		case Vunbind:
+			action = verb;
+			break;
+		case Vether:
+			conf.type = argv[0];
+			if(argc > 1){
+				conf.dev = argv[1];
+				argc--, argv++;
+			}
+			break;
+		}
+		if(verb < 0)
+			break;
+		argc--, argv++;
 	}
 
 	// get addresses
@@ -255,7 +256,7 @@ main(int argc, char **argv)
 		break;
 	}
 
-	switch(verb){
+	switch(action){
 	case Vadd:
 		doadd(retry);
 		break;
@@ -277,6 +278,8 @@ doadd(int retry)
 
 	// get number of preexisting interfaces
 	nip = nipifcs(conf.mpoint);
+	if(nip == 0)
+		beprimary = 1;
 
 	// get ipifc into name space and condition device for ip
 	if(!noconfig){
@@ -285,7 +288,7 @@ doadd(int retry)
 		binddevice();
 	}
 
-	if(!validip(conf.laddr) && strcmp(conf.type, "ppp") != 0)
+	if(!validip(conf.laddr))
 		dodhcp = 1;
 
 	// run dhcp if we need something
@@ -318,7 +321,7 @@ doadd(int retry)
 	}
 
 	// leave everything we've learned somewhere other procs can find it
-	if(nip == 0){
+	if(beprimary){
 		putndb();
 		tweakservers();
 	}
@@ -355,7 +358,7 @@ doremove(void)
 				fprint(2, "%s: can't open %s: %r\n", argv0, conf.mpoint);
 				continue;
 			}
-			if(fprint(cfd, "remove %I %I", lifc->ip, lifc->mask) < 0)
+			if(fprint(cfd, "remove %I %M", lifc->ip, lifc->mask) < 0)
 				fprint(2, "%s: can't remove %I %I from %s: %r\n", argv0,
 					lifc->ip, lifc->mask, file);
 		}
@@ -462,60 +465,8 @@ void
 binddevice(void)
 {
 	char buf[256];
-	int ac, pid;
-	char *av[12];
-	Waitmsg *w;
-
-	if(strcmp(conf.type, "ppp") == 0){
-		// ppp does the binding
-
-		// start with an empty config file
-		if(nip == 0)
-			writendb("", 0, 0);
-
-		switch(pid = rfork(RFPROC|RFFDG|RFMEM)){
-		case -1:
-			sysfatal("can't start ppp: %r");
-			break;
-		case 0:
-			ac = 0;
-			av[ac++] = "ppp";
-			av[ac++] = "-uf";
-			av[ac++] = "-p";
-			av[ac++] = conf.dev;
-			av[ac++] = "-x";
-			av[ac++] = conf.mpoint;
-			if(conf.baud != nil){
-				av[ac++] = "-b";
-				av[ac++] = conf.baud;
-			}
-			av[ac] = 0;
-			exec("/bin/ip/ppp", av);
-			exec("/ppp", av);
-			sysfatal("execing /ppp: %r");
-		default:
-			break;
-		}
-
-		// wait for ppp to finish connecting and configuring
-		w = nil;
-		for(;;){
-			free(w);
-			w = wait();
-			if(w == nil)
-				sysfatal("/ppp disappeared");
-			if(w->pid == pid){
-				if(w->msg[0] != 0)
-					sysfatal("/ppp exited with status: %s", w->msg);
-				free(w);
-				break;
-			}
-		}
 
-		// ppp sets up the configuration itself
-		noconfig = 1;
-		getndb();
-	} else if(myifc < 0){
+	if(myifc < 0){
 		// get a new ip interface
 		snprint(buf, sizeof(buf), "%s/ipifc/clone", conf.mpoint);
 		conf.cfd = open(buf, ORDWR);
@@ -563,7 +514,7 @@ ipconfig(void)
 		return -1;
 	}
 
-	if(nip == 0 && validip(conf.gaddr))
+	if(beprimary && validip(conf.gaddr))
 		adddefroute(conf.mpoint, conf.gaddr);
 
 	return 0;
@@ -593,7 +544,7 @@ ipunconfig(void)
 	ipmove(conf.mask, IPnoaddr);
 
 	// forget configuration info
-	if(nip == 0)
+	if(beprimary)
 		writendb("", 0, 0);
 }
 
@@ -658,6 +609,9 @@ dhcpwatch(int needconfig)
 	int secs, s;
 	ulong t;
 
+	if(nodhcpwatch)
+		return;
+
 	switch(rfork(RFPROC|RFFDG|RFNOWAIT|RFNOTEG)){
 	default:
 		return;
@@ -705,7 +659,7 @@ dhcpwatch(int needconfig)
 			needconfig = 0;
 
 			// leave everything we've learned somewhere other procs can find it
-			if(nip == 0){
+			if(beprimary){
 				putndb();
 				tweakservers();
 			}
@@ -778,7 +732,7 @@ dhcpsend(int type)
 	uchar *p;
 	int n;
 	uchar vendor[64];
-	Udphdr *up = (Udphdr*)bp.udphdr;
+	OUdphdr *up = (OUdphdr*)bp.udphdr;
 
 	memset(&bp, 0, sizeof(bp));
 
@@ -1020,6 +974,8 @@ openlisten()
 		cfd = announce(data, devdir);
 		if(cfd >= 0)
 			break;
+		if(!noconfig)
+			sysfatal("can't announce for dhcp: %r");
 
 		// might be another client - wait and try again
 		fprint(2, "%s: can't announce: %r\n", argv0);
@@ -1030,6 +986,7 @@ openlisten()
 
 	if(fprint(cfd, "headers") < 0)
 		sysfatal("can't set header mode: %r");
+	fprint(cfd, "oldheaders");
 
 	sprint(data, "%s/data", devdir);
 
@@ -1417,6 +1374,11 @@ nipifcs(char *net)
 	n = 0;
 	ifc = readipifc(net, ifc, -1);
 	for(nifc = ifc; nifc != nil; nifc = nifc->next){
+		/*
+		 * ignore loopback devices when trying to
+		 * figure out if we're the primary interface.
+		 */
+		if(strcmp(nifc->dev, "/dev/null") != 0)
 		for(lifc = nifc->lifc; lifc != nil; lifc = lifc->next)
 			if(validip(lifc->ip)){
 				n++;
@@ -1439,6 +1401,7 @@ char *verbs[] = {
 [Vadd]		"add",
 [Vremove]	"remove",
 [Vunbind]	"unbind",
+[Vether]	"ether",
 };
 
 // look for an action

+ 1 - 0
sys/src/cmd/ip/udpecho.c

@@ -36,6 +36,7 @@ main(int argc, char **argv)
 		sysfatal("can't announce: %r");
 	if(fprint(cfd, "headers") < 0)
 		sysfatal("can't set header mode: %r");
+	fprint(cfd, "oldheaders");
 
 	sprint(data, "%s/data", devdir);
 

+ 3 - 1
sys/src/cmd/ndb/convM2DNS.c

@@ -144,7 +144,7 @@ gbytes(Scan *sp, uchar **p, int n)
 {
 	if(sp->err)
 		return 0;
-	if(sp->p+n > sp->ep){
+	if(sp->p+n > sp->ep || n < 0){
 		sp->err = toolong;
 		return 0;
 	}
@@ -246,6 +246,8 @@ retry:
 	USHORT(len);
 	data = sp->p;
 
+	if(sp->p + len > sp->ep)
+		sp->err = toolong;
 	if(sp->err){
 		rrfree(rp);
 		return 0;

+ 8 - 8
sys/src/cmd/ndb/dnresolve.c

@@ -283,7 +283,7 @@ mkreq(DN *dp, int type, uchar *buf, ushort reqno)
 {
 	DNSmsg m;
 	int len;
-	Udphdr *uh = (Udphdr*)buf;
+	OUdphdr *uh = (OUdphdr*)buf;
 
 	/* stuff port number into output buffer */
 	memset(uh, 0, sizeof(*uh));
@@ -297,7 +297,7 @@ mkreq(DN *dp, int type, uchar *buf, ushort reqno)
 	m.qd = rralloc(type);
 	m.qd->owner = dp;
 	m.qd->type = type;
-	len = convDNS2M(&m, &buf[Udphdrsize], Maxudp);
+	len = convDNS2M(&m, &buf[OUdphdrsize], Maxudp);
 	if(len < 0)
 		abort(); /* "can't convert" */;
 	rrfree(m.qd);
@@ -345,15 +345,15 @@ readreply(int fd, DN *dp, int type, ushort req,
 
 		/* timed read */
 		alarm((endtime - now) * 1000);
-		len = read(fd, ibuf, Udphdrsize+Maxudpin);
+		len = read(fd, ibuf, OUdphdrsize+Maxudpin);
 		alarm(0);
-		len -= Udphdrsize;
+		len -= OUdphdrsize;
 		if(len < 0)
 			return -1;	/* timed out */
 		
 		/* convert into internal format  */
 		memset(mp, 0, sizeof(*mp));
-		err = convM2DNS(&ibuf[Udphdrsize], len, mp);
+		err = convM2DNS(&ibuf[OUdphdrsize], len, mp);
 		if(err){
 			syslog(0, LOG, "input err %s: %I", err, ibuf);
 			continue;
@@ -617,7 +617,7 @@ netquery1(int fd, DN *dp, int type, RR *nsrp, Request *reqp, int depth, uchar *i
 			if(debug)
 				logsend(reqp->id, depth, obuf, p->s->name,
 					dp->name, type);
-			if(write(fd, obuf, len + Udphdrsize) < 0)
+			if(write(fd, obuf, len + OUdphdrsize) < 0)
 				warning("sending udp msg %r");
 			p->nx++;
 		}
@@ -744,8 +744,8 @@ netquery(DN *dp, int type, RR *nsrp, Request *reqp, int depth)
 		return 0;
 
 	/* use alloced buffers rather than ones from the stack */
-	ibuf = emalloc(Maxudpin+Udphdrsize);
-	obuf = emalloc(Maxudp+Udphdrsize);
+	ibuf = emalloc(Maxudpin+OUdphdrsize);
+	obuf = emalloc(Maxudp+OUdphdrsize);
 
 	slave(reqp);
 

+ 15 - 13
sys/src/cmd/ndb/dnudpserver.c

@@ -22,7 +22,7 @@ typedef struct Inprogress Inprogress;
 struct Inprogress
 {
 	int	inuse;
-	Udphdr	uh;
+	OUdphdr	uh;
 	DN	*owner;
 	int	type;
 	int	id;
@@ -37,9 +37,9 @@ static Inprogress*
 clientrxmit(DNSmsg *req, uchar *buf)
 {
 	Inprogress *p, *empty;
-	Udphdr *uh;
+	OUdphdr *uh;
 
-	uh = (Udphdr *)buf;
+	uh = (OUdphdr *)buf;
 	empty = 0;
 	for(p = inprog; p < &inprog[Maxactive]; p++){
 		if(p->inuse == 0){
@@ -50,7 +50,7 @@ clientrxmit(DNSmsg *req, uchar *buf)
 		if(req->id == p->id)
 		if(req->qd->owner == p->owner)
 		if(req->qd->type == p->type)
-		if(memcmp(uh, &p->uh, Udphdrsize) == 0)
+		if(memcmp(uh, &p->uh, OUdphdrsize) == 0)
 			return 0;
 	}
 	if(empty == 0)
@@ -59,7 +59,7 @@ clientrxmit(DNSmsg *req, uchar *buf)
 	empty->id = req->id;
 	empty->owner = req->qd->owner;
 	empty->type = req->qd->type;
-	memmove(&empty->uh, uh, Udphdrsize);
+	memmove(&empty->uh, uh, OUdphdrsize);
 	empty->inuse = 1;
 	return empty;
 }
@@ -73,11 +73,11 @@ dnudpserver(char *mntpt)
 	int fd, len;
 	Request req;
 	DNSmsg reqmsg, repmsg;
-	uchar buf[Udphdrsize + Maxudp + 1024];
+	uchar buf[OUdphdrsize + Maxudp + 1024];
 	char *err;
 	Inprogress *p;
 	char tname[32];
-	Udphdr *uh;
+	OUdphdr *uh;
 
 	/* fork sharing text, data, and bss with parent */
 	switch(rfork(RFPROC|RFNOTEG|RFMEM|RFNOWAIT)){
@@ -107,13 +107,13 @@ restart:
 		alarm(60*1000);
 		len = read(fd, buf, sizeof(buf));
 		alarm(0);
-		if(len <= Udphdrsize)
+		if(len <= OUdphdrsize)
 			goto restart;
-		uh = (Udphdr*)buf;
-		len -= Udphdrsize;
+		uh = (OUdphdr*)buf;
+		len -= OUdphdrsize;
 		getactivity(&req);
 		req.aborttime = now + 30;	/* don't spend more than 30 seconds */
-		err = convM2DNS(&buf[Udphdrsize], len, &reqmsg);
+		err = convM2DNS(&buf[OUdphdrsize], len, &reqmsg);
 		if(err){
 			syslog(0, logfile, "server: input error: %s from %I", err, buf);
 			continue;
@@ -177,6 +177,7 @@ freereq:
  *  announce on udp port and set message style interface
  */
 static char *hmsg = "headers";
+static char *ohmsg = "oldheaders";
 
 static int
 udpannounce(char *mntpt)
@@ -197,6 +198,7 @@ udpannounce(char *mntpt)
 	/* turn on header style interface */
 	if(write(ctl, hmsg, strlen(hmsg)) , 0)
 		abort(); /* hmsg */;
+	write(ctl, ohmsg, strlen(ohmsg));
 	data = open(datafile, ORDWR);
 	if(data < 0){
 		close(ctl);
@@ -221,7 +223,7 @@ reply(int fd, uchar *buf, DNSmsg *rep, Request *reqp)
 			rep->id, rep->qd->owner->name,
 			rrname(rep->qd->type, tname, sizeof tname), rep->an, rep->ns, rep->ar);
 
-	len = convDNS2M(rep, &buf[Udphdrsize], Maxudp);
+	len = convDNS2M(rep, &buf[OUdphdrsize], Maxudp);
 	if(len <= 0){
 		syslog(0, logfile, "error converting reply: %s %d", rep->qd->owner->name,
 			rep->qd->type);
@@ -233,7 +235,7 @@ reply(int fd, uchar *buf, DNSmsg *rep, Request *reqp)
 			syslog(0, logfile, "ar %R", rp);
 		return;
 	}
-	len += Udphdrsize;
+	len += OUdphdrsize;
 	if(write(fd, buf, len) != len)
 		syslog(0, logfile, "error sending reply: %r");
 }

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

@@ -24,7 +24,7 @@
 #define PROMPT()	fprint(2, "\a") /* BEL */
 #define TABS(N,C)	if((N = intopt(argv, &C)) < 0) N = DEFTAB
 #define ETABS		(Inpos % Etabn)
-#define ITABS		(Itabn > 0 && Nspace >= (nc = Itabn - Outpos % Itabn))
+#define ITABS		(Itabn > 0 && Nspace > 1 && Nspace >= (nc = Itabn - Outpos % Itabn))
 #define NSEPC		'\t'
 #define EMPTY		14	/* length of " -- empty file" */
 

+ 1 - 0
sys/src/libsunrpc/udp.c

@@ -87,6 +87,7 @@ sunSrvUdp(SunSrv *srv, char *address)
 		close(acfd);
 		return -1;
 	}
+	write(acfd, "oldheaders", 10);
 	snprint(data, sizeof data, "%s/data", adir);
 	if((fd = open(data, ORDWR)) < 0){
 		werrstr("open %s: %r", data);