Browse Source

Plan 9 from Bell Labs 2007-07-20

David du Colombier 17 years ago
parent
commit
1eade886bb

+ 24 - 17
dist/replica/_plan9.db

@@ -6079,7 +6079,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 1178768502 2597
+sys/include/ip.h - 664 sys sys 1184885967 4027
 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
@@ -7642,7 +7642,7 @@ 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/i82365 - 664 sys sys 954378906 884
-sys/man/3/ip - 664 sys sys 1181506841 24876
+sys/man/3/ip - 664 sys sys 1184886992 25934
 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
@@ -7974,7 +7974,7 @@ 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/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 1184794680 4561
+sys/src/9/ip/ipv6.h - 664 sys sys 1184881241 4114
 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
@@ -7984,7 +7984,7 @@ sys/src/9/ip/ptclbsum.c - 664 sys sys 1022588099 1243
 sys/src/9/ip/rudp.c - 664 sys sys 1184794930 21494
 sys/src/9/ip/tcp.c - 664 sys sys 1184471371 65911
 sys/src/9/ip/tripmedium.c - 664 sys sys 1045063515 7136
-sys/src/9/ip/udp.c - 664 sys sys 1184794700 13319
+sys/src/9/ip/udp.c - 664 sys sys 1184847548 13314
 sys/src/9/mkfile - 664 sys sys 1063857477 205
 sys/src/9/mtx - 20000000775 sys sys 1123676466 0
 sys/src/9/mtx/clock.c - 664 sys sys 1032053278 1293
@@ -8179,7 +8179,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 1178553988 31116
+sys/src/9/port/devsd.c - 664 sys sys 1184847548 31123
 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
@@ -12462,9 +12462,9 @@ 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 1181070455 7744
+sys/src/cmd/ip/6in4.c - 664 sys sys 1184878450 7455
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
-sys/src/cmd/ip/dhcp.h - 664 sys sys 1178483074 3419
+sys/src/cmd/ip/dhcp.h - 664 sys sys 1184880651 3419
 sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1178482836 11969
 sys/src/cmd/ip/dhcpd - 20000000775 sys sys 1063897571 0
 sys/src/cmd/ip/dhcpd/dat.h - 664 sys sys 1084471353 2522
@@ -12472,8 +12472,8 @@ sys/src/cmd/ip/dhcpd/db.c - 664 sys sys 1143670612 7466
 sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1179429075 33386
 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 1172959226 6235
-sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1169162185 1163
+sys/src/cmd/ip/dhcpd/ndb.c - 664 sys sys 1184887309 5741
+sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1184887281 1177
 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
@@ -12511,7 +12511,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 1169162039 1563
+sys/src/cmd/ip/icmp.h - 664 sys sys 1184887609 1457
 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
@@ -12533,15 +12533,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 1178051838 5666
-sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1178051839 19588
-sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1179231088 38062
-sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1177092388 236
-sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1177092388 1128
+sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1184880748 5635
+sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1184880748 19731
+sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1184880913 38660
+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 1177099730 867
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1177479927 1260
-sys/src/cmd/ip/ping.c - 664 sys sys 1178055342 9699
+sys/src/cmd/ip/ping.c - 664 sys sys 1184892499 8666
 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
@@ -12612,7 +12612,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 1180651317 8699
+sys/src/cmd/ip/traceroute.c - 664 sys sys 1184887073 8733
 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
@@ -15841,3 +15841,10 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/ip/dhcpd - 775 sys sys 1184901769 149586
+386/bin/ip/ipconfig - 775 sys sys 1184901769 157384
+386/bin/ip/ping - 775 sys sys 1184901770 82522
+386/lib/libip.a - 664 sys sys 1184901770 34710
+386/lib/libndb.a - 664 sys sys 1184901770 64470
+386/lib/libsunrpc.a - 664 sys sys 1184901771 353148
+sys/src/cmd/ip/ping.c - 664 sys sys 1184900703 10237

+ 23 - 23
dist/replica/plan9.db

@@ -287,7 +287,7 @@
 386/bin/ip - 20000000775 sys sys 1016920851 0
 386/bin/ip/6in4 - 775 sys sys 1179777651 88513
 386/bin/ip/dhcpclient - 775 sys sys 1178568281 92992
-386/bin/ip/dhcpd - 775 sys sys 1179458669 149879
+386/bin/ip/dhcpd - 775 sys sys 1184901769 149586
 386/bin/ip/dhcpleases - 775 sys sys 1178568281 85069
 386/bin/ip/ftpd - 775 sys sys 1181507267 170562
 386/bin/ip/gping - 775 sys sys 1179372093 182147
@@ -303,9 +303,9 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1178568286 113828
 386/bin/ip/httpfile - 775 sys sys 1184731238 283966
 386/bin/ip/imap4d - 775 sys sys 1179372095 236829
-386/bin/ip/ipconfig - 775 sys sys 1179259380 157017
+386/bin/ip/ipconfig - 775 sys sys 1184901769 157384
 386/bin/ip/linklocal - 775 sys sys 1177530964 42790
-386/bin/ip/ping - 775 sys sys 1178568288 83220
+386/bin/ip/ping - 775 sys sys 1184901770 82522
 386/bin/ip/ppp - 775 sys sys 1179372096 219103
 386/bin/ip/pppoe - 775 sys sys 1168402326 77787
 386/bin/ip/pptp - 775 sys sys 1184731239 127160
@@ -562,19 +562,19 @@
 386/lib/libgeometry.a - 664 sys sys 1168402366 50470
 386/lib/libhtml.a - 664 sys sys 1184529911 229152
 386/lib/libhttpd.a - 664 sys sys 1181332906 99734
-386/lib/libip.a - 664 sys sys 1178826954 34710
+386/lib/libip.a - 664 sys sys 1184901770 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 1178826955 64470
+386/lib/libndb.a - 664 sys sys 1184901770 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 1184529912 353148
+386/lib/libsunrpc.a - 664 sys sys 1184901771 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
@@ -6079,7 +6079,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 1178768502 2597
+sys/include/ip.h - 664 sys sys 1184885967 4027
 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
@@ -7642,7 +7642,7 @@ 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/i82365 - 664 sys sys 954378906 884
-sys/man/3/ip - 664 sys sys 1181506841 24876
+sys/man/3/ip - 664 sys sys 1184886992 25934
 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
@@ -7974,7 +7974,7 @@ 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/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 1184794680 4561
+sys/src/9/ip/ipv6.h - 664 sys sys 1184881241 4114
 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
@@ -7984,7 +7984,7 @@ sys/src/9/ip/ptclbsum.c - 664 sys sys 1022588099 1243
 sys/src/9/ip/rudp.c - 664 sys sys 1184794930 21494
 sys/src/9/ip/tcp.c - 664 sys sys 1184471371 65911
 sys/src/9/ip/tripmedium.c - 664 sys sys 1045063515 7136
-sys/src/9/ip/udp.c - 664 sys sys 1184794700 13319
+sys/src/9/ip/udp.c - 664 sys sys 1184847548 13314
 sys/src/9/mkfile - 664 sys sys 1063857477 205
 sys/src/9/mtx - 20000000775 sys sys 1123676466 0
 sys/src/9/mtx/clock.c - 664 sys sys 1032053278 1293
@@ -8179,7 +8179,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 1178553988 31116
+sys/src/9/port/devsd.c - 664 sys sys 1184847548 31123
 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
@@ -12462,9 +12462,9 @@ 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 1181070455 7744
+sys/src/cmd/ip/6in4.c - 664 sys sys 1184878450 7455
 sys/src/cmd/ip/arp.h - 664 sys sys 944961005 751
-sys/src/cmd/ip/dhcp.h - 664 sys sys 1178483074 3419
+sys/src/cmd/ip/dhcp.h - 664 sys sys 1184880651 3419
 sys/src/cmd/ip/dhcpclient.c - 664 sys sys 1178482836 11969
 sys/src/cmd/ip/dhcpd - 20000000775 sys sys 1063897571 0
 sys/src/cmd/ip/dhcpd/dat.h - 664 sys sys 1084471353 2522
@@ -12472,8 +12472,8 @@ sys/src/cmd/ip/dhcpd/db.c - 664 sys sys 1143670612 7466
 sys/src/cmd/ip/dhcpd/dhcpd.c - 664 sys sys 1179429075 33386
 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 1172959226 6235
-sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1169162185 1163
+sys/src/cmd/ip/dhcpd/ndb.c - 664 sys sys 1184887309 5741
+sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1184887281 1177
 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
@@ -12511,7 +12511,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 1169162039 1563
+sys/src/cmd/ip/icmp.h - 664 sys sys 1184887609 1457
 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
@@ -12533,15 +12533,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 1178051838 5666
-sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1178051839 19588
-sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1179231088 38062
-sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1177092388 236
-sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1177092388 1128
+sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1184880748 5635
+sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1184880748 19731
+sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1184880913 38660
+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 1177099730 867
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1177479927 1260
-sys/src/cmd/ip/ping.c - 664 sys sys 1178055342 9699
+sys/src/cmd/ip/ping.c - 664 sys sys 1184900703 10237
 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
@@ -12612,7 +12612,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 1180651317 8699
+sys/src/cmd/ip/traceroute.c - 664 sys sys 1184887073 8733
 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

+ 30 - 0
dist/replica/plan9.log

@@ -49609,3 +49609,33 @@
 1184796004 10 c sys/src/9/ip/udp.c - 664 sys sys 1184794700 13319
 1184796004 11 c sys/src/9/port/latin1.h - 664 sys sys 1184794985 3575
 1184796004 12 d sys/src/9/boot/libboot.a8 - 664 sys sys 1161222921 0
+1184848205 0 c sys/src/9/ip/udp.c - 664 sys sys 1184847548 13314
+1184848205 1 c sys/src/9/port/devsd.c - 664 sys sys 1184847548 31123
+1184873404 0 c sys/man/3/ip - 664 sys sys 1184873334 24887
+1184878804 0 c sys/src/cmd/ip/6in4.c - 664 sys sys 1184878450 7455
+1184880605 0 c sys/include/ip.h - 664 sys sys 1184880475 3835
+1184880605 1 c sys/man/3/ip - 664 sys sys 1184880478 26235
+1184880605 2 c sys/src/cmd/ip/dhcp.h - 664 sys sys 1184880651 3419
+1184882405 0 c sys/src/9/ip/ipv6.h - 664 sys sys 1184881241 4114
+1184882405 1 c sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1184880748 5635
+1184882405 2 c sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1184880748 19731
+1184882405 3 c sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1184880913 38660
+1184882405 4 c sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1184880750 233
+1184882405 5 c sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
+1184884204 0 c sys/man/3/ip - 664 sys sys 1184884102 26135
+1184886003 0 c sys/include/ip.h - 664 sys sys 1184885967 4027
+1184886003 1 c sys/man/3/ip - 664 sys sys 1184885959 25870
+1184887804 0 c sys/man/3/ip - 664 sys sys 1184886992 25934
+1184887804 1 c sys/src/cmd/ip/dhcpd/ndb.c - 664 sys sys 1184887309 5741
+1184887804 2 c sys/src/cmd/ip/dhcpd/ping.c - 664 sys sys 1184887281 1177
+1184887804 3 c sys/src/cmd/ip/icmp.h - 664 sys sys 1184887609 1457
+1184887804 4 c sys/src/cmd/ip/ping.c - 664 sys sys 1184887620 9711
+1184887804 5 c sys/src/cmd/ip/traceroute.c - 664 sys sys 1184887073 8733
+1184893204 0 c sys/src/cmd/ip/ping.c - 664 sys sys 1184892499 8666
+1184902211 0 c 386/bin/ip/dhcpd - 775 sys sys 1184901769 149586
+1184902211 1 c 386/bin/ip/ipconfig - 775 sys sys 1184901769 157384
+1184902211 2 c 386/bin/ip/ping - 775 sys sys 1184901770 82522
+1184902211 3 c 386/lib/libip.a - 664 sys sys 1184901770 34710
+1184902211 4 c 386/lib/libndb.a - 664 sys sys 1184901770 64470
+1184902211 5 c 386/lib/libsunrpc.a - 664 sys sys 1184901771 353148
+1184902211 6 c sys/src/cmd/ip/ping.c - 664 sys sys 1184900703 10237

+ 62 - 0
sys/include/ip.h

@@ -7,6 +7,7 @@ enum
 	IPv4addrlen=	4,
 	IPv4off=	12,
 	IPllen=		4,
+	IPV4HDR_LEN=	20,
 };
 
 /*
@@ -62,6 +63,67 @@ struct Ipifc
 	Ipv6rp	rp;
 };
 
+#define ISIPV6MCAST(addr)	((addr)[0] == 0xff)
+#define ISIPV6LINKLOCAL(addr) ((addr)[0] == 0xfe && ((addr)[1] & 0xc0) == 0x80)
+
+/*
+ * ipv6 constants
+ * `ra' is `router advertisement', `rs' is `router solicitation'.
+ * `na' is `neighbour advertisement'.
+ */
+enum {
+	IPV6HDR_LEN	= 40,
+
+	/* option types */
+	V6opt_srclladdr	= 1,
+	V6opt_targlladdr= 2,
+	V6opt_pfxinfo	= 3,
+	V6opt_redirhdr	= 4,
+	V6opt_mtu	= 5,
+
+	/* Router constants (all times in ms.) */
+	Maxv6initraintvl= 16000,
+	Maxv6initras	= 3,
+	Maxv6finalras	= 3,
+	Minv6interradelay= 3000,
+	Maxv6radelay	= 500,
+
+	/* Host constants */
+	Maxv6rsdelay	= 1000,
+	V6rsintvl	= 4000,
+	Maxv6rss	= 3,
+
+	/* Node constants */
+	Maxv6mcastrss	= 3,
+	Maxv6unicastrss	= 3,
+	Maxv6anycastdelay= 1000,
+	Maxv6na		= 3,
+	V6reachabletime	= 30000,
+	V6retranstimer	= 1000,
+	V6initprobedelay= 5000,
+};
+
+/* V6 header on the wire */
+typedef struct Ip6hdr Ip6hdr;
+struct Ip6hdr {
+	uchar	vcf[4];		/* version:4, traffic class:8, flow label:20 */
+	uchar	ploadlen[2];	/* payload length: packet length - 40 */
+	uchar	proto;		/* next header type */
+	uchar	ttl;		/* hop limit */
+	uchar	src[IPaddrlen];	/* source address */
+	uchar	dst[IPaddrlen];	/* destination address */
+};
+
+/*
+ *  user-level icmpv6 with control message "headers"
+ */
+typedef struct Icmp6hdr Icmp6hdr;
+struct Icmp6hdr {
+	uchar	unused[8];
+	uchar	laddr[IPaddrlen];	/* local address */
+	uchar	raddr[IPaddrlen];	/* remote address */
+};
+
 /*
  *  user level udp headers with control message "headers"
  */

+ 85 - 13
sys/man/3/ip

@@ -56,7 +56,7 @@ new IP networks or implementing firewalls or proxy
 services.
 .PP
 All addresses used are 16-byte IPv6 addresses.
-We implement IPv4 and IPv6.
+The IP device implements IPv4 and IPv6.
 IPv4 addresses are a subset of the IPv6 addresses and both standard
 .SM ASCII
 formats are accepted.
@@ -353,6 +353,8 @@ indicate what routing protocol originated the route.
 Writing to
 .B /net/iproute
 changes the route table.  The messages are:
+.TF "tag str"
+.PD
 .TP
 .B flush
 Remove all routes.
@@ -373,14 +375,17 @@ Remove a route with a matching target and mask.
 The file
 .B /net/arp
 controls information about address resolution.
-The kernel automatically updates the ARP information for Ethernet
-interfaces.
+The kernel automatically updates the v4 ARP and v6 Neighbour Discovery
+information for Ethernet interfaces.
 When read, the file returns one line per address containing the
 type of medium, the status of the entry (OK, WAIT), the IP
 address, and the medium address.
 Writing to
 .B /net/arp
-administers the ARP information.  The control messages are:
+administers the ARP information.
+The control messages are:
+.TF "del addr"
+.PD
 .TP
 .B flush
 Remove all entries.
@@ -402,6 +407,8 @@ update the table on other systems.
 .PP
 Currently, the only medium type is
 .BR ether .
+.br
+.ne 3
 .SS "Debugging and stack information
 .PP
 If any process is holding
@@ -657,6 +664,8 @@ ends.
 TCP
 .B ctl
 files support the following additional messages:
+.TF keepaliven
+.PD
 .TP
 .B hangup
 close down a TCP connection
@@ -743,12 +752,14 @@ RUDP is a reliable datagram protocol based on UDP.
 Packets are delivered in order.
 RUDP does not support
 .BR listen .
-One must use either
+One must write either
 .B connect
 or
 .B announce
 followed immediately by
-.BR headers .
+.B headers
+to
+.BR ctl .
 .PP
 Unlike IL or TCP, the reboot of one end of a connection does
 not force a closing of the connection.  Communications will
@@ -756,7 +767,7 @@ resume when the rebooted machine resumes talking.  Any unacknowledged
 packets queued before the reboot will be lost.  A reboot can
 be detected by reading the
 .B err
-file.  It will have the message
+file.  It will contain the message
 .IP
 .BI hangup\  address ! port
 .PP
@@ -772,10 +783,52 @@ all queued messages are dropped, an error is queued to the
 file, and the conversation resumes.
 .SS ICMP
 .PP
-ICMP is a datagram protocol used to exchange control requests and
+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' packets from user programs.
+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
+.BR ctl ,
+then before a write,
+a user must prefix each message with a corresponding structure,
+declared in
+.BR <ip.h> .
+.TP
+.B headers
+.EX
+/*
+ *  user level icmpv6 with control message "headers"
+ */
+typedef struct Icmp6hdr Icmp6hdr;
+struct Icmp6hdr {
+	uchar	unused[8];
+	uchar	laddr[IPaddrlen];	/* local address */
+	uchar	raddr[IPaddrlen];	/* remote address */
+};
+.EE
+.PP
+In this case (writing
+.L headers
+to the
+.I ctl
+file),
+no
+.I listen
+nor
+.I accept
+is needed;
+otherwise,
+the usual sequence of
+.IR announce ,
+.IR listen ,
+.I accept
+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.  Like TCP, IL delivers datagrams
@@ -809,6 +862,8 @@ On write, the kernel fills in the
 .B eproto
 field with the port number specified
 in the connect message.
+.br
+.ne 3
 .SS ESP
 .PP
 ESP is the Encapsulating Security Payload (RFC 1827).
@@ -961,12 +1016,15 @@ older > younger
 So far this has just been used to implement a version of
 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.
+files are read only and contain statistics useful to network monitoring.
+.br
+.ne 14
 .PP
 Reading
 .B /net/ipifc/stats
@@ -999,10 +1057,12 @@ fragments created
 .1C
 .ft
 .EE
+.br
+.ne 16
 .PP
 Reading
 .B /net/icmp/stats
-returns a list of 25 tagged and newline-separated fields representing:
+returns a list of 26 tagged and newline-separated fields representing:
 .EX
 .ft 1
 .2C
@@ -1076,7 +1136,7 @@ datagrams sent
 .PP
 Reading
 .B /net/il/stats
-returns a list of 7 tagged and newline-separated fields representing:
+returns a list of 6 tagged and newline-separated fields representing:
 .EX
 .ft 1
 .2C
@@ -1105,6 +1165,18 @@ header length errors
 .IR ip (2),
 .IR ndb (6),
 .IR listen (8)
+.br
+.PD 0
+.TF /lib/rfc/rfc2822
+.TP
+.B /lib/rfc/rfc2460
+IPv6
+.TP
+.B /lib/rfc/rfc4291
+IPv6 address architecture
+.TP
+.B /lib/rfc/rfc4443
+ICMPv6
 .SH SOURCE
 .B /sys/src/9/ip
 .SH BUGS

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

@@ -99,26 +99,9 @@ enum {
 	Tuniproxy	= 2,
 	Tunirany	= 3,
 
-	/* Router constants (all times in milliseconds) */
-	MAX_INIT_RTR_ADVERT_INTVL = 16000,
-	MAX_INIT_RTR_ADVERTS	= 3,
-	MAX_FINAL_RTR_ADVERTS	= 3,
-	MIN_DELAY_BETWEEN_RAS	= 3000,
-	MAX_RA_DELAY_TIME	= 500,
-
-	/* Host constants */
-	MAX_RTR_SOLICIT_DELAY	= 1000,
-	RTR_SOLICIT_INTVL	= 4000,
-	MAX_RTR_SOLICITS	= 3,
-
 	/* Node constants */
 	MAX_MULTICAST_SOLICIT	= 3,
-	MAX_UNICAST_SOLICIT	= 3,
-	MAX_ANYCAST_DELAY_TIME	= 1000,
-	MAX_NEIGHBOR_ADVERT	= 3,
-	REACHABLE_TIME		= 30000,
 	RETRANS_TIMER		= 1000,
-	DELAY_FIRST_PROBE_TIME	= 5000,
 };
 
 typedef struct Ip6hdr	Ip6hdr;

+ 5 - 5
sys/src/9/ip/udp.c

@@ -40,7 +40,7 @@ struct Udp4hdr
 	uchar	length[2];	/* packet length */
 	uchar	id[2];		/* Identification */
 	uchar	frag[2];	/* Fragment information */
-	uchar	Unused;	
+	uchar	Unused;
 	uchar	udpproto;	/* Protocol */
 	uchar	udpplen[2];	/* Header plus data length */
 	uchar	udpsrc[IPv4addrlen];	/* Ip source */
@@ -285,7 +285,7 @@ udpkick(void *x, Block *bp)
 		hnputs(uh4->udplen, ptcllen);
 		uh4->udpcksum[0] = 0;
 		uh4->udpcksum[1] = 0;
-		hnputs(uh4->udpcksum, 
+		hnputs(uh4->udpcksum,
 		       ptclcsum(bp, UDP4_PHDR_OFF, dlen+UDP_UDPHDR_SZ+UDP4_PHDR_SZ));
 		uh4->vihl = IP_VER4;
 		ipoput4(f, bp, 0, c->ttl, c->tos, rc);
@@ -297,7 +297,7 @@ udpkick(void *x, Block *bp)
 			return;
 
 		/*
-		 * using the v6 ip header to create pseudo header 
+		 * using the v6 ip header to create pseudo header
 		 * first then reset it to the normal ip header
 		 */
 		uh6 = (Udp6hdr *)(bp->rp);
@@ -322,7 +322,7 @@ udpkick(void *x, Block *bp)
 		hnputs(uh6->udplen, ptcllen);
 		uh6->udpcksum[0] = 0;
 		uh6->udpcksum[1] = 0;
-		hnputs(uh6->udpcksum, 
+		hnputs(uh6->udpcksum,
 		       ptclcsum(bp, UDP6_PHDR_OFF, dlen+UDP_UDPHDR_SZ+UDP6_PHDR_SZ));
 		memset(uh6, 0, 8);
 		uh6->viclfl[0] = IP_VER6;
@@ -360,7 +360,7 @@ udpiput(Proto *udp, Ipifc *ifc, Block *bp)
 	uh4 = (Udp4hdr*)(bp->rp);
 	version = ((uh4->vihl&0xF0)==IP_VER6) ? 6 : 4;
 
-	/* Put back pseudo header for checksum 
+	/* Put back pseudo header for checksum
 	 * (remember old values for icmpnoconv()) */
 	switch(version) {
 	case V4:

+ 6 - 5
sys/src/9/port/devsd.c

@@ -136,7 +136,7 @@ sdaddpart(SDunit* unit, char* name, ulong start, ulong end)
 }
 
 static void
-sddelpart(SDunit* unit,  char* name)
+sddelpart(SDunit* unit, char* name)
 {
 	int i;
 	SDpart *pp;
@@ -397,7 +397,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 	switch(i){
 	case Qctl:
 		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qctl),
-			   unit->vers, QTFILE);
+			unit->vers, QTFILE);
 		perm = &unit->ctlperm;
 		if(emptystr(perm->user)){
 			kstrdup(&perm->user, eve);
@@ -409,7 +409,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 
 	case Qraw:
 		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qraw),
-			   unit->vers, QTFILE);
+			unit->vers, QTFILE);
 		perm = &unit->rawperm;
 		if(emptystr(perm->user)){
 			kstrdup(&perm->user, eve);
@@ -423,7 +423,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 		pp = &unit->part[PART(c->qid)];
 		l = (pp->end - pp->start) * (vlong)unit->secsize;
 		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qpart),
-			   unit->vers+pp->vers, QTFILE);
+			unit->vers+pp->vers, QTFILE);
 		if(emptystr(pp->user))
 			kstrdup(&pp->user, eve);
 		devdir(c, q, pp->name, l, pp->user, pp->perm, dp);
@@ -556,7 +556,7 @@ sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
 		}
 		l = (pp->end - pp->start) * (vlong)unit->secsize;
 		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), i, Qpart),
-			    unit->vers+pp->vers, QTFILE);
+			unit->vers+pp->vers, QTFILE);
 		if(emptystr(pp->user))
 			kstrdup(&pp->user, eve);
 		devdir(c, q, pp->name, l, pp->user, pp->perm, dp);
@@ -881,6 +881,7 @@ sdsetsense(SDreq *r, int status, int key, int asc, int ascq)
 	unit->sense[12] = asc;
 	unit->sense[13] = ascq;
 
+	r->status = status;
 	if(status == SDcheck && !(r->flags & SDnosense)){
 		/* request sense case from sdfakescsi */
 		len = sizeof unit->sense;

+ 0 - 11
sys/src/cmd/ip/6in4.c

@@ -188,8 +188,6 @@ main(int argc, char **argv)
 }
 
 typedef struct Iphdr Iphdr;
-typedef struct Ip6hdr Ip6hdr;
-
 struct Iphdr
 {
 	uchar	vihl;		/* Version and header length */
@@ -204,15 +202,6 @@ struct Iphdr
 	uchar	dst[4];		/* Ip destination (uchar ordering unimportant) */
 };
 
-struct	Ip6hdr {
-	uchar	vcf[4];		/* version:4, traffic class:8, flow label:20 */
-	uchar	ploadlen[2];	/* payload length: packet length - 40 */
-	uchar	proto;		/* next header type */
-	uchar	ttl;		/* hop limit */
-	uchar	src[IPaddrlen];
-	uchar	dst[IPaddrlen];
-};
-
 #define STFHDR (sizeof(Iphdr))
 
 static void

+ 0 - 19
sys/src/cmd/ip/dhcpd/ndb.c

@@ -8,8 +8,6 @@
 #include <ndb.h>
 #include "dat.h"
 
-static void check72(Info *iip);
-
 Ndb *db;
 char *ndbfile;
 
@@ -202,8 +200,6 @@ lookup(Bootp *bp, Info *iip, Info *riip)
 		if(lookupip(ciaddr, iip, 0) < 0)
 			return -1;	/* don't know anything about it */
 
-check72(iip);
-
 		if(!samenet(riip->ipaddr, iip)){
 			warning(0, "%I not on %I", ciaddr, riip->ipnet);
 			return -1;
@@ -301,18 +297,3 @@ lookupname(char *val, Ndbtuple *t)
 			break;
 		}
 }
-
-uchar slash120[IPaddrlen] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-				0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0 };
-uchar net72[IPaddrlen] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
-				0x0, 0x0, 0xff, 0xff, 135, 104, 72, 0 };
-
-static void
-check72(Info *iip)
-{
-	uchar net[IPaddrlen];
-
-	maskip(iip->ipaddr, slash120, net);
-	if(ipcmp(net, net72) == 0)
-		syslog(0, blog, "check72 %I %M gw %I", iip->ipaddr, iip->ipmask, iip->gwip);
-}

+ 2 - 1
sys/src/cmd/ip/dhcpd/ping.c

@@ -17,6 +17,7 @@ catch(void *a, char *msg)
 
 /*
  *  make sure noone is using the address
+ *  IPv4 only
  */
 int
 icmpecho(uchar *a)
@@ -46,7 +47,7 @@ icmpecho(uchar *a)
 		strcpy((char*)ip->data, MSG);
 		ip->seq[0] = sseq;
 		ip->seq[1] = sseq>>8;
-		len = ICMP_IPSIZE+ICMP_HDRSIZE+sizeof(MSG);
+		len = IPV4HDR_LEN+ICMP_HDRSIZE+sizeof(MSG);
 
 		/* send a request */
 		if(write(fd, buf, len) < len)

+ 14 - 20
sys/src/cmd/ip/icmp.h

@@ -38,10 +38,20 @@ enum
 
 	Maxtype6	= 137,
 
-	ICMP_IPSIZE	= 20,
 	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
 {
@@ -56,28 +66,12 @@ struct Icmp
 	uchar	src[4];		/* Ip source */
 	uchar	dst[4];		/* Ip destination */
 
-	uchar	type;
-	uchar	code;
-	uchar	cksum[2];
-	uchar	icmpid[2];
-	uchar	seq[2];
-	uchar	data[1];
+	Icmphdr;
 };
 
 typedef struct Icmp6 Icmp6;
 struct Icmp6
 {
-	uchar	vcf[4];
-	uchar	ploadlen[2];
-	uchar	proto;
-	uchar	ttl;
-	uchar	src[16];		/* Ip source */
-	uchar	dst[16];		/* Ip destination */
-
-	uchar	type;
-	uchar	code;
-	uchar	cksum[2];
-	uchar	icmpid[2];
-	uchar	seq[2];
-	uchar	data[1];
+	Ip6hdr;
+	Icmphdr;
 };

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

@@ -148,7 +148,6 @@ void	v6paraminit(Conf *);
 
 typedef struct Headers Headers;
 typedef struct Ip4hdr  Ip4hdr;
-typedef struct Ip6hdr  Ip6hdr;
 typedef struct Lladdropt Lladdropt;
 typedef struct Mtuopt Mtuopt;
 typedef struct Prefixopt Prefixopt;

+ 40 - 33
sys/src/cmd/ip/ipconfig/ipv6.c

@@ -6,9 +6,6 @@
 #include <libc.h>
 #include <bio.h>
 #include <ip.h>
-typedef struct Block Block;
-typedef struct Fs Fs;
-#include "/sys/src/9/ip/ipv6.h"
 #include "ipconfig.h"
 #include "../icmp.h"
 
@@ -61,11 +58,11 @@ char *icmpmsg6[Maxtype6+1] =
 static char *icmp6opts[] =
 {
 [0]		"unknown opt",
-[SRC_LLADDR]	"sll_addr",
-[TARGET_LLADDR]	"tll_addr",
-[PREFIX_INFO]	"pref_opt",
-[REDIR_HEADER]	"redirect",
-[MTU_OPTION]	"mtu_opt",
+[V6opt_srclladdr]	"sll_addr",
+[V6opt_targlladdr]	"tll_addr",
+[V6opt_pfxinfo]	"pref_opt",
+[V6opt_redirhdr]	"redirect",
+[V6opt_mtu]	"mtu_opt",
 };
 
 uchar v6allroutersL[IPaddrlen] = {
@@ -89,6 +86,13 @@ uchar v6Unspecified[IPaddrlen] = {
 	0, 0, 0, 0
 };
 
+uchar v6loopback[IPaddrlen] = {
+	0, 0, 0, 0,
+	0, 0, 0, 0,
+	0, 0, 0, 0,
+	0, 0, 0, 1
+};
+
 uchar v6glunicast[IPaddrlen] = {
 	0x08, 0, 0, 0,
 	0, 0, 0, 0,
@@ -176,11 +180,11 @@ v6paraminit(Conf *cf)
 	cf->sendra = cf->recvra = 0;
 	cf->mflag = 0;
 	cf->oflag = 0;
-	cf->maxraint = MAX_INIT_RTR_ADVERT_INTVL;
-	cf->minraint = MAX_INIT_RTR_ADVERT_INTVL / 4;
+	cf->maxraint = Maxv6initraintvl;
+	cf->minraint = Maxv6initraintvl / 4;
 	cf->linkmtu = 1500;
-	cf->reachtime = REACHABLE_TIME;
-	cf->rxmitra = RETRANS_TIMER;
+	cf->reachtime = V6reachabletime;
+	cf->rxmitra = V6retranstimer;
 	cf->ttl = MAXTTL;
 
 	cf->routerlt = 0;
@@ -206,15 +210,15 @@ opt_seprint(uchar *ps, uchar *pe, char *sps, char *spe)
 		switch (otype) {
 		default:
 			return seprint(p, e, " option=%s ", icmp6opts[otype]);
-		case SRC_LLADDR:
-		case TARGET_LLADDR:
+		case V6opt_srclladdr:
+		case V6opt_targlladdr:
 			if (pktsz < osz || osz != 8)
 				return seprint(p, e, " option=%s bad size=%d",
 					icmp6opts[otype], osz);
 			p = seprint(p, e, " option=%s maddr=%E",
 				icmp6opts[otype], a+2);
 			break;
-		case PREFIX_INFO:
+		case V6opt_pfxinfo:
 			if (pktsz < osz || osz != 32)
 				return seprint(p, e, " option=%s: bad size=%d",
 					icmp6opts[otype], osz);
@@ -557,7 +561,7 @@ recvrahost(uchar buf[], int pktlen)
 	while (pktlen - m > 0) {
 		optype = buf[m];
 		switch (optype) {
-		case SRC_LLADDR:
+		case V6opt_srclladdr:
 			llao = (Lladdropt *)&buf[m];
 			m += 8 * buf[m+1];
 			if (llao->len != 1) {
@@ -589,18 +593,18 @@ recvrahost(uchar buf[], int pktlen)
 					conf.mpoint);
 			close(arpfd);
 			break;
-		case TARGET_LLADDR:
-		case REDIR_HEADER:
+		case V6opt_targlladdr:
+		case V6opt_redirhdr:
 			m += 8 * buf[m+1];
 			ralog("ignoring unexpected optype %s in Routeradv",
 				icmp6opts[optype]);
 			break;
-		case MTU_OPTION:
+		case V6opt_mtu:
 			mtuo = (Mtuopt*)&buf[m];
 			m += 8 * mtuo->len;
 			conf.linkmtu = nhgetl(mtuo->mtu);
 			break;
-		case PREFIX_INFO:
+		case V6opt_pfxinfo:
 			prfo = (Prefixopt*)&buf[m];
 			m += 8 * prfo->len;
 			if (prfo->len != 4) {
@@ -638,7 +642,7 @@ recvra6(void)
 		sysfatal("can't open icmp_ra connection: %r");
 
 	notify(catch);
-	sendrscnt = MAX_RTR_SOLICITS;
+	sendrscnt = Maxv6rss;
 
 	switch(rfork(RFPROC|RFMEM|RFFDG|RFNOWAIT|RFNOTEG)){
 	case -1:
@@ -659,14 +663,14 @@ recvra6(void)
 					if (recvra6on(conf.mpoint, myifc) ==
 					    IsHostRecv)
 						sendrs(fd);
-					sleepfor = RTR_SOLICIT_INTVL+nrand(100);
+					sleepfor = V6rsintvl+nrand(100);
 				}
 				if (sendrscnt == 0) {
 					sendrscnt--;
 					sleepfor = 0;
 					ralog(
 				"recvra6: no router advs after %d sols on %s",
-						 MAX_RTR_SOLICITS, conf.dev);
+						 Maxv6rss, conf.dev);
 				}
 				continue;
 			}
@@ -713,7 +717,7 @@ recvrs(uchar *buf, int pktlen, uchar *sol)
 
 	if (optsz != sizeof *llao)
 		return 0;
-	if (buf[n] != SRC_LLADDR || 8*buf[n+1] != sizeof *llao) {
+	if (buf[n] != V6opt_srclladdr || 8*buf[n+1] != sizeof *llao) {
 		ralog("rs opt err %s", abuf);
 		return -1;
 	}
@@ -783,7 +787,10 @@ sendra(int fd, uchar *dst, int rlt)
 	for (lifc = (ifc? ifc->lifc: nil); lifc; lifc = nlifc) {
 		nlifc = lifc->next;
 		prfo = (Prefixopt *)(buf + pktsz);
-		if (isv6global(lifc->ip)) {
+		/* global unicast address? */
+		if (!ISIPV6LINKLOCAL(lifc->ip) && !ISIPV6MCAST(lifc->ip) &&
+		    memcmp(lifc->ip, IPnoaddr, IPaddrlen) != 0 &&
+		    memcmp(lifc->ip, v6loopback, IPaddrlen) != 0) {
 			memmove(prfo->pref, lifc->net, IPaddrlen);
 
 			/* hack to find prefix length */
@@ -793,7 +800,7 @@ sendra(int fd, uchar *dst, int rlt)
 			if (prfo->plen == 0)
 				continue;
 
-			prfo->type = PREFIX_INFO;
+			prfo->type = V6opt_pfxinfo;
 			prfo->len = 4;
 			prfo->lar = AFMASK;
 			hnputl(prfo->validlt, lifc->validlt);
@@ -806,7 +813,7 @@ sendra(int fd, uchar *dst, int rlt)
 	 * link layer address option
 	 */
 	llao = (Lladdropt *)(buf + pktsz);
-	llao->type = SRC_LLADDR;
+	llao->type = V6opt_srclladdr;
 	llao->len = 1;
 	memmove(llao->lladdr, macaddr, sizeof macaddr);
 	pktsz += sizeof *llao;
@@ -834,8 +841,8 @@ sendra6(void)
 		sysfatal("can't open icmp_rs connection: %r");
 
 	notify(catch);
-	sendracnt = MAX_INIT_RTR_ADVERTS;
-	nquitmsgs = MAX_FINAL_RTR_ADVERTS;
+	sendracnt = Maxv6initras;
+	nquitmsgs = Maxv6finalras;
 
 	switch(rfork(RFPROC|RFMEM|RFFDG|RFNOWAIT|RFNOTEG)){
 	case -1:
@@ -863,7 +870,7 @@ sendra6(void)
 				if (nquitmsgs > 0) {
 					sendra(fd, v6allnodesL, 0);
 					nquitmsgs--;
-					sleepfor = MIN_DELAY_BETWEEN_RAS +
+					sleepfor = Minv6interradelay +
 						nrand(10);
 					continue;
 				} else {
@@ -871,7 +878,7 @@ sendra6(void)
 					exits(0);
 				}
 
-			nquitmsgs = MAX_FINAL_RTR_ADVERTS;
+			nquitmsgs = Maxv6finalras;
 
 			if (n <= 0) {		/* no router solicitations */
 				if (sendracnt > 0)
@@ -883,10 +890,10 @@ sendra6(void)
 				dstknown = recvrs(buf, n, dst);
 				ctime = time(0);
 
-				if (ctime - lastra < MIN_DELAY_BETWEEN_RAS) {
+				if (ctime - lastra < Minv6interradelay) {
 					/* too close, skip */
 					sleepfor = lastra +
-						MIN_DELAY_BETWEEN_RAS +
+						Minv6interradelay +
 						nrand(10) - ctime;
 					continue;
 				}

+ 43 - 15
sys/src/cmd/ip/ipconfig/main.c

@@ -7,9 +7,6 @@
 #include <bio.h>
 #include <ndb.h>
 #include "../dhcp.h"
-typedef struct Block Block;
-typedef struct Fs Fs;
-#include "/sys/src/9/ip/ipv6.h"
 #include "ipconfig.h"
 
 #define DEBUG if(debug)print
@@ -201,6 +198,7 @@ uchar*	optadd(uchar*, int, void*, int);
 uchar*	optaddulong(uchar*, int, ulong);
 uchar*	optaddvec(uchar*, int, uchar*, int);
 int	optgetaddrs(uchar*, int, uchar*, int);
+int	optgetp9addrs(uchar*, int, uchar*, int);
 int	optgetaddr(uchar*, int, uchar*);
 int	optgetbyte(uchar*, int);
 int	optgetstr(uchar*, int, char*, int);
@@ -222,10 +220,10 @@ void	writendb(char*, int, int);
 void
 usage(void)
 {
-	fprint(2,
-"usage: %s [-6dDGnNOpPruX][-x mtpt][-m mtu][-b baud][-g gw][-h host][-c ctl]*"
-	" [-o dhcpopt] type dev [verb] [laddr [mask [raddr [fs [auth]]]]]\n",
-		argv0);
+	fprint(2, "usage: %s [-6dDGnNOpPruX][-b baud][-c ctl]* [-g gw]"
+		"[-h host][-m mtu]\n"
+		"\t[-x mtpt][-o dhcpopt] type dev [verb] [laddr [mask "
+		"[raddr [fs [auth]]]]]\n", argv0);
 	exits("usage");
 }
 
@@ -523,6 +521,7 @@ main(int argc, char **argv)
 	default:
 		usage();
 	} ARGEND;
+	argv0 = "ipconfig";		/* boot invokes us as tcp? */
 
 	action = parseargs(argc, argv);
 	switch(action){
@@ -583,13 +582,14 @@ doadd(int retry)
 		if (ip6cfg(ipv6auto) < 0)
 			sysfatal("can't automatically start IPv6 on %s",
 				conf.dev);
-		return;
+//		return;
 	} else if (validip(conf.laddr) && !isv4(conf.laddr)) {
 		if (ip6cfg(0) < 0)
 			sysfatal("can't start IPv6 on %s, address %I",
 				conf.dev, conf.laddr);
-		return;
+//		return;
 	}
+
 	if(!validip(conf.laddr) && !ppp)
 		if(dondbconfig)
 			ndbconfig();
@@ -1246,23 +1246,31 @@ dhcprecv(void)
 		/* get anything else we asked for */
 		getoptions(bp->optdata);
 
-		/* get plan9 specific options */
+		/* get plan9-specific options */
 		n = optgetvec(bp->optdata, OBvendorinfo, vopts, sizeof vopts-1);
 		if(n > 0 && parseoptions(vopts, n) == 0){
 			if(validip(conf.fs) && Oflag)
 				n = 1;
-			else
-				n = optgetaddrs(vopts, OP9fs, conf.fs, 2);
+			else {
+//				n = optgetp9addrs(vopts, OP9fs, conf.fs, 2);
+//				if (n == 0)
+					n = optgetaddrs(vopts, OP9fs,
+						conf.fs, 2);
+			}
 			for(i = 0; i < n; i++)
 				DEBUG("fs=%I ", conf.fs + i*IPaddrlen);
+
 			if(validip(conf.auth) && Oflag)
 				n = 1;
-			else
-				n = optgetaddrs(vopts, OP9auth, conf.auth, 2);
+			else {
+//				n = optgetp9addrs(vopts, OP9auth, conf.auth, 2);
+//				if (n == 0)
+					n = optgetaddrs(vopts, OP9auth,
+						conf.auth, 2);
+			}
 			for(i = 0; i < n; i++)
 				DEBUG("auth=%I ", conf.auth + i*IPaddrlen);
 		}
-
 		conf.lease = lease;
 		conf.state = Sbound;
 		DEBUG("server=%I sname=%s\n", conf.server, conf.sname);
@@ -1365,6 +1373,7 @@ optaddstr(uchar *p, int op, char *v)
 	return p+2+n;
 }
 
+/* parse p, looking for option `op'; return ptr to opt, store length via np */
 uchar*
 optget(uchar *p, int op, int *np)
 {
@@ -1442,6 +1451,24 @@ optgetaddrs(uchar *p, int op, uchar *ip, int n)
 	return i;
 }
 
+int
+optgetp9addrs(uchar *ap, int op, uchar *ip, int n)
+{
+	int len, i, slen;
+	char *p;
+
+	p = (char *)optget(ap, op, &len);
+	if(p == nil)
+		return 0;
+	for (i = 0; i < n && len > 0; i++) {
+		slen = strlen(p) + 1;
+		parseip(&ip[i*IPaddrlen], p);
+		p += slen;
+		len -= slen;
+	}
+	return i;
+}
+
 int
 optgetvec(uchar *p, int op, uchar *v, int n)
 {
@@ -1572,6 +1599,7 @@ writendb(char *s, int n, int append)
 		fd = open(file, OWRITE|OTRUNC);
 	write(fd, s, n);
 	close(fd);
+write(1, s, n);		/* DEBUG */
 }
 
 /* put server addresses into the ndb entry */

+ 1 - 1
sys/src/cmd/ip/ipconfig/mkfile

@@ -11,7 +11,7 @@ HFILES=\
 	../dhcp.h\
 	../icmp.h\
 	ipconfig.h\
-	/sys/src/9/ip/ipv6.h\
+	/sys/include/ip.h\
 
 BIN=/$objtype/bin/ip
 

+ 0 - 3
sys/src/cmd/ip/ipconfig/ppp.c

@@ -4,9 +4,6 @@
 #include <bio.h>
 #include <ndb.h>
 #include "../dhcp.h"
-typedef struct Block Block;
-typedef struct Fs Fs;
-#include "/sys/src/9/ip/ipv6.h"
 #include "ipconfig.h"
 
 void

+ 120 - 146
sys/src/cmd/ip/ping.c

@@ -27,36 +27,36 @@ struct Req
 };
 
 typedef struct {
+	int	version;
 	char	*net;
+	int	echocmd;
 	int	echoreply;
-	unsigned icmphdrsz;
-	int	(*getttl)(void *v);
-	int	(*getseq)(void *v);
-	void	(*putseq)(void *v, ushort seq);
-	int	(*gettype)(void *v);
-	void	(*settype)(void *v);
-	int	(*getcode)(void *v);
-	void	(*setcode)(void *v);
+	unsigned iphdrsz;
+
 	void	(*prreply)(Req *r, void *v);
 	void	(*prlost)(ushort seq, void *v);
 } Proto;
 
+
 Req	*first;		/* request list */
 Req	*last;		/* ... */
 Lock	listlock;
 
 char *argv0;
+
+int addresses;
 int debug;
-int quiet;
-int lostonly;
+int done;
+int flood;
 int lostmsgs;
+int lostonly;
+int quiet;
 int rcvdmsgs;
-int done;
 int rint;
-vlong sum;
 ushort firstseq;
-int addresses;
-int flood;
+vlong sum;
+
+static char *network, *target;
 
 void lost(Req*, void*);
 void reply(Req*, void*);
@@ -82,100 +82,12 @@ catch(void *a, char *msg)
 		noted(NDFLT);
 }
 
-
-static int
-getttl4(void *v)
-{
-	return ((Icmp *)v)->ttl;
-}
-
-static int
-getttl6(void *v)
-{
-	return ((Icmp6 *)v)->ttl;
-}
-
-static int
-getseq4(void *v)
-{
-	return nhgets(((Icmp *)v)->seq);
-}
-
-static int
-getseq6(void *v)
-{
-	Icmp6 *ip6 = v;
-
-	return ip6->seq[1]<<8 | ip6->seq[0];
-}
-
-static void
-putseq4(void *v, ushort seq)
-{
-	hnputs(((Icmp *)v)->seq, seq);
-}
-
-static void
-putseq6(void *v, ushort seq)
-{
-	((Icmp6 *)v)->seq[0] = seq;
-	((Icmp6 *)v)->seq[1] = seq>>8;
-}
-
-static int
-gettype4(void *v)
-{
-	return ((Icmp *)v)->type;
-}
-
-static int
-gettype6(void *v)
-{
-	return ((Icmp6 *)v)->type;
-}
-
-static void
-settype4(void *v)
-{
-	((Icmp *)v)->type = EchoRequest;
-}
-
-static void
-settype6(void *v)
-{
-	((Icmp6 *)v)->type = EchoRequestV6;
-}
-
-static int
-getcode4(void *v)
-{
-	return ((Icmp *)v)->code;
-}
-
-static int
-getcode6(void *v)
-{
-	return ((Icmp6 *)v)->code;
-}
-
-static void
-setcode4(void *v)
-{
-	((Icmp *)v)->code = 0;
-}
-
-static void
-setcode6(void *v)
-{
-	((Icmp6 *)v)->code = 0;
-}
-
 static void
 prlost4(ushort seq, void *v)
 {
 	Icmp *ip4 = v;
 
-	print("lost %ud: %V->%V\n", seq, ip4->src, ip4->dst);
+	print("lost %ud: %V -> %V\n", seq, ip4->src, ip4->dst);
 }
 
 static void
@@ -183,7 +95,7 @@ prlost6(ushort seq, void *v)
 {
 	Icmp6 *ip6 = v;
 
-	print("lost %ud: %I->%I\n", seq, ip6->src, ip6->dst);
+	print("lost %ud: %I -> %I\n", seq, ip6->src, ip6->dst);
 }
 
 static void
@@ -191,7 +103,7 @@ prreply4(Req *r, void *v)
 {
 	Icmp *ip4 = v;
 
-	print("%ud: %V->%V rtt %lld µs, avg rtt %lld µs, ttl = %d\n",
+	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,
 		r->ttl);
 }
@@ -199,50 +111,47 @@ prreply4(Req *r, void *v)
 static void
 prreply6(Req *r, void *v)
 {
-	Icmp *ip6 = v;
+	Icmp6 *ip6 = v;
 
-	print("%ud: %I->%I rtt %lld µs, avg rtt %lld µs, ttl = %d\n",
+	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,
 		r->ttl);
 }
 
 static Proto v4pr = {
-	"icmp",
-	EchoReply,
-	sizeof(Icmp),
-	getttl4,
-	getseq4,
-	putseq4,
-	gettype4,
-	settype4,
-	getcode4,
-	setcode4,
-	prreply4,
-	prlost4,
+	4,		"icmp",
+	EchoRequest,	EchoReply,
+	IPV4HDR_LEN,
+	prreply4,	prlost4,
 };
 static Proto v6pr = {
-	"icmpv6",
-	EchoReplyV6,
-	sizeof(Icmp6),
-	getttl6,
-	getseq6,
-	putseq6,
-	gettype6,
-	settype6,
-	getcode6,
-	setcode6,
-	prreply6,
-	prlost6,
+	6,		"icmpv6",
+	EchoRequestV6,	EchoReplyV6,
+	IPV6HDR_LEN,
+	prreply6,	prlost6,
 };
 
 static Proto *proto = &v4pr;
 
 
+Icmphdr *
+geticmp(void *v)
+{
+	char *p = v;
+
+	p += proto->iphdrsz;
+	return (Icmphdr *)p;
+}
+
 void
 clean(ushort seq, vlong now, void *v)
 {
+	int ttl;
 	Req **l, *r;
 
+	ttl = 0;
+	if (v)
+		ttl = proto->version == 4? ((Icmp *)v)->ttl: ((Icmp6 *)v)->ttl;
 	lock(&listlock);
 	last = nil;
 	for(l = &first; *l; ){
@@ -250,7 +159,7 @@ clean(ushort seq, vlong now, void *v)
 
 		if(v && r->seq == seq){
 			r->rtt = now-r->time;
-			r->ttl = (*proto->getttl)(v);
+			r->ttl = ttl;
 			reply(r, v);
 		}
 
@@ -258,7 +167,7 @@ clean(ushort seq, vlong now, void *v)
 			*l = r->next;
 			r->rtt = now-r->time;
 			if(v)
-				r->ttl = (*proto->getttl)(v);
+				r->ttl = ttl;
 			if(r->replied == 0)
 				lost(r, v);
 			free(r);
@@ -270,21 +179,79 @@ clean(ushort seq, vlong now, void *v)
 	unlock(&listlock);
 }
 
+static uchar loopbacknet[IPaddrlen] = {
+	0, 0, 0, 0,
+	0, 0, 0, 0,
+	0, 0, 0xff, 0xff,
+	127, 0, 0, 0
+};
+static uchar loopbackmask[IPaddrlen] = {
+	0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff,
+	0xff, 0, 0, 0
+};
+
+/*
+ * find first ip addr suitable for proto and
+ * that isn't the friggin loopback address
+ * unless there are no others.
+ */
+static int
+myipvnaddr(uchar *ip, Proto *proto, char *net)
+{
+	int ipisv4, wantv4;
+	Ipifc *nifc;
+	Iplifc *lifc;
+	uchar mynet[IPaddrlen];
+	static Ipifc *ifc;
+	
+	wantv4 = proto->version == 4;
+	ifc = readipifc(net, ifc, -1);
+	for(nifc = ifc; nifc; nifc = nifc->next)
+		for(lifc = nifc->lifc; lifc; lifc = lifc->next){
+			maskip(lifc->ip, loopbackmask, mynet);
+			if(ipcmp(mynet, loopbacknet) == 0)
+				continue;
+			ipisv4 = isv4(lifc->ip) != 0;
+			if(ipcmp(lifc->ip, IPnoaddr) != 0 && wantv4 == ipisv4){
+				ipmove(ip, lifc->ip);
+				return 0;
+			}
+		}
+	ipmove(ip, IPnoaddr);
+	return -1;
+}
+
 void
 sender(int fd, int msglen, int interval, int n)
 {
 	int i, extra;
 	ushort seq;
 	char buf[64*1024+512];
+	uchar me[IPaddrlen], mev4[IPv4addrlen];
+	Icmphdr *icmp;
 	Req *r;
 
 	srand(time(0));
 	firstseq = seq = rand();
 
-	for(i = proto->icmphdrsz; i < msglen; i++)
+	icmp = geticmp(buf);
+	memset(buf, 0, proto->iphdrsz + ICMP_HDRSIZE);
+	for(i = proto->iphdrsz + ICMP_HDRSIZE; i < msglen; i++)
 		buf[i] = i;
-	(*proto->settype)(buf);
-	(*proto->setcode)(buf);
+	icmp->type = proto->echocmd;
+	icmp->code = 0;
+
+	/* arguably the kernel should fill in the right src addr. */
+	myipvnaddr(me, proto, network);
+	if (proto->version == 4) {
+		v6tov4(mev4, me);
+		memmove(((Icmp *)buf)->src, mev4, IPv4addrlen);
+	} else
+		ipmove(((Ip6hdr *)buf)->src, me);
+	if (addresses)
+		print("\t%I -> %s\n", me, target);
 
 	for(i = 0; i < n; i++){
 		if(i != 0){
@@ -294,7 +261,7 @@ sender(int fd, int msglen, int interval, int n)
 		r = malloc(sizeof *r);
 		if (r == nil)
 			continue;
-		(*proto->putseq)(buf, seq);
+		hnputs(icmp->seq, seq);
 		r->seq = seq;
 		r->next = nil;
 		r->replied = 0;
@@ -323,6 +290,7 @@ rcvr(int fd, int msglen, int interval, int nmsg)
 	ushort x;
 	vlong now;
 	uchar buf[64*1024+512];
+	Icmphdr *icmp;
 	Req *r;
 
 	sum = 0;
@@ -339,18 +307,18 @@ rcvr(int fd, int msglen, int interval, int nmsg)
 			print("bad len %d/%d\n", n, msglen);
 			continue;
 		}
+		icmp = geticmp(buf);
 		munged = 0;
-		for(i = proto->icmphdrsz; i < msglen; i++)
+		for(i = proto->iphdrsz + ICMP_HDRSIZE; i < msglen; i++)
 			if(buf[i] != (uchar)i)
 				munged++;
 		if(munged)
 			print("corrupted reply\n");
-		x = (*proto->getseq)(buf);
-		if((*proto->gettype)(buf) != proto->echoreply ||
-		   (*proto->getcode)(buf) != 0) {
-			print("bad sequence/code/type %d/%d/%d\n",
-				(*proto->gettype)(buf), (*proto->getcode)(buf),
-				x);
+		x = nhgets(icmp->seq);
+		if(icmp->type != proto->echoreply || icmp->code != 0) {
+			print("bad type/code/sequence %d/%d/%d (want %d/%d/%d)\n",
+				icmp->type, icmp->code, x,
+				proto->echoreply, 0, x);
 			continue;
 		}
 		clean(x, now, buf);
@@ -451,6 +419,9 @@ _dial_string_parse(char *str, DS *ds)
 	}
 }
 
+/* end excerpt from /sys/src/libc/9sys/dial.c */
+
+/* side effect: sets network & target */
 static int
 isv4name(char *name)
 {
@@ -469,6 +440,7 @@ isv4name(char *name)
 		else {
 			*pr++ = '\0';
 			root = ds.netdir;
+			network = strdup(root);
 		}
 		if (strcmp(pr, v4pr.net) == 0)
 			return 1;
@@ -477,6 +449,8 @@ isv4name(char *name)
 	}
 
 	/* if it's a literal, it's obvious from syntax which proto it is */
+	free(target);
+	target = strdup(ds.rem);
 	if (isdottedquad(ds.rem))
 		return 1;
 	else if (isv6lit(ds.rem))
@@ -545,8 +519,8 @@ main(int argc, char **argv)
 		break;
 	} ARGEND;
 
-	if(msglen < proto->icmphdrsz)
-		msglen = proto->icmphdrsz;
+	if(msglen < proto->iphdrsz + ICMP_HDRSIZE)
+		msglen = proto->iphdrsz + ICMP_HDRSIZE;
 	if(msglen < 64)
 		msglen = 64;
 	if(msglen >= 64*1024)

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

@@ -3,6 +3,7 @@
 #include <ctype.h>
 #include <bio.h>
 #include <ndb.h>
+#include <ip.h>
 #include "icmp.h"
 
 enum{
@@ -179,6 +180,7 @@ udpprobe(int cfd, int dfd, char *dest, int interval)
 #define MSG "traceroute probe"
 #define MAGIC 0xdead
 
+/* ICMPv4 only */
 static int
 icmpprobe(int cfd, int dfd, char *dest, int interval)
 {
@@ -202,7 +204,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 = ICMP_IPSIZE+ICMP_HDRSIZE+sizeof(MSG);
+		len = IPV4HDR_LEN+ICMP_HDRSIZE+sizeof(MSG);
 
 		/* send a request */
 		if(write(dfd, buf, len) < len)