Subject: incoming ppp again
To: None <port-macppc@netbsd.org>
From: Donald Lee <MacPPC@caution.icompute.com>
List: port-macppc
Date: 05/10/2004 09:15:27
listers,

I have my server _almost_ ready.  I have to be able to support dial-up, though.

A couple of pointers from someone who knows this code could save me
a lot of time.  I need to know which operations/actions on the part of
pppd cause the route to be assigned to the ppp0 device when pppd
"answers the phone".

I would very much appreciate it if someone would point me in the right
direction on this.  I have a workaround, but would rather generate a fix,
which I can file with my send-pr.

My remaining problem is that pppd is not setting up the route to the ppp
device, and I don't know why.  I've compared the source to pppd between
NetBSD 1.5.2 (where it works) and NetBSD 1.6.2 (where it does not).

The difference between 1.5.2 and 1.6.2 is as follows.  This is output from
"route monitor" on the two machines.  "mercy" is running 1.5.2 - works.
"grace" is running 1.6.2 - busted.

first mercy (slightly formatted for easy reading)

	mercy# route monitor
	got message of size 80 on Sun May  9 18:14:13 2004
	RTM_NEWADDR: address being added to iface: len 80, metric 0, flags: sockaddrs: <NETMASK,IFP,IFA,BRD>
	 255.255.255.224 ppp0 mercy dialup1

	got message of size 108 on Sun May  9 18:14:13 2004
	RTM_ADD: Add Route: len 108, pid: 0, seq 0, errno 0, flags:<UP,HOST>
	locks:  inits:
	sockaddrs: <DST,GATEWAY>
	 dialup1 mercy

	got message of size 144 on Sun May  9 18:14:13 2004
	RTM_IFINFO: iface status change: len 144, if# 4, flags:<UP,PTP,RUNNING,MULTICAST>

	got message of size 84 on Sun May  9 18:14:13 2004
	RTM_OIFINFO: iface status change (pre-1.5): len 84, pid: 385876992, seq 1500, errno 0, flags:<UP,DYNAMIC,DONE,PROTO1>
	locks: <recvpipe,expire> inits: <rttvar,sendpipe,recvpipe,expire,hopcount,mtu>
	sockaddrs:
	 (158) bb.45.00.08.2f.b9.00.00.00.00.00.00.00.00.0

	got message of size 112 on Sun May  9 18:14:13 2004
	RTM_ADD: Add Route: len 112, pid: 9760, seq 1, errno 0, flags:<HOST,DONE,STATIC,PROTO2>
	locks:  inits: <expire>
	sockaddrs: <DST,GATEWAY>
	 dialup1 epic0:0.e0.29.9e.93.32


Now grace: (busted)

	grace# route monitor
	got message of size 144 on Mon May 10 08:55:46 2004
	RTM_IFINFO: iface status change: len 144, if# 4, carrier: unknown, flags:<UP,PTP,RUNNING,MULTICAST>

	got message of size 84 on Mon May 10 08:55:46 2004
	RTM_OIFINFO: iface status change (pre-1.5): len 84, pid: 385876992, seq 1500, errno 0, flags:<UP,DYNAMIC,DONE,PROTO1>
	locks: <expire,hopcount> inits: <rtt,sendpipe,expire,mtu>
	sockaddrs: 
	 (159) 89.e2.00.04.ed.fe.00.00.00.00.00.00.00.00.0

	got message of size 112 on Mon May 10 08:55:46 2004
	RTM_ADD: Add Route: len 112, pid: 2735, seq 1, errno 0, flags:<HOST,DONE,STATIC,PROTO2>
	locks:  inits: <expire>
	sockaddrs: <DST,GATEWAY>
	 dialup1 tlp0:0.0.94.a0.bd.93

Note that the RTM_NEWADDR and RTM_ADD operations are missing.  This
is apparently the problem.

On teardown, you can see a similar, parallel difference.  mercy
removes the address and route, and grace does not.

If I perform a "route add dialup1 -interface grace", then ppp works
fine.  In fact, that "sticks".  It does not appear that it
will be necessary to put it in the connect/disconnect
scripts for ppp, I can do it once at boot for the pppX
interfacces and I'm done.

Can anyone tell me what is supposed to generate these two
route operations?

Thanks in advance,

-dgl-