3 # $FreeBSD: src/usr.sbin/route6d/misc/chkrt,v 1.1 1999/12/28 02:37:10 shin Exp $
4 # $DragonFly: src/usr.sbin/route6d/misc/chkrt,v 1.2 2003/06/17 04:30:02 dillon Exp $
6 $dump="/var/tmp/route6d_dump";
7 $pidfile="/var/run/route6d.pid";
11 open(FD
, "< $pidfile") || die "Can not open $pidfile";
15 system("kill -INT $_");
17 open(NS
, "/usr/local/v6/bin/netstat -r -n|") || die "Can not open netstat";
20 next unless (/^3f/ || /^5f/);
29 open(FD
, "< $dump") || die "Can not open $dump";
32 next unless (/^ 3f/ || /^ 5f/);
35 $f[2] =~ /if\(\d:([a-z0-9]+)\)/;
37 $f[3] =~ /gw\(([a-z0-9:]+)\)/;
41 $f[5] =~ /age\((\d+)\)/;
43 unless (defined($gw{$dst})) {
44 print "NOT FOUND: $dst $intf $gateway $metric $age\n";
48 if ($gw{$dst} ne $gateway && $gw{$dst} !~ /link#\d+/) {
49 print "WRONG GW: $dst $intf $gateway $metric $age\n";
50 print "kernel gw: $gw{$dst}\n";
54 if ($int{$dst} ne $intf) {
55 print "WRONG IF: $dst $intf $gateway $metric $age\n";
56 print "kernel if: $int{$dst}\n";
64 print "No error found\n";