Subject: Packet misdirection (kernel bug?)
To: None <tech-kern@netbsd.org>
From: Brad du Plessis <bradd@cat.co.za>
List: tech-kern
Date: 01/23/2004 11:52:29
Hi,

I've tried other mailing lists with no comeback and was wondering if some=
one=20
here could help me.

Consider the following setup:

   192.168.10
A ------------ B (modem)

I have boxes A and B on the same subnet as shown. B has a modem, and also=
 has=20
a route setup to a default gateway on the same subnet.

Now, when a connection via the modem is made, the ppp interface creates r=
outes=20
to the remote IP address via the local IP address setup for the=20
point-to-point interface. A route is then setup on A to use this modem=20
connection.=20

This works fine on most occasions, but sometimes after the connection has=
 been=20
closed on B, box A will still be sending packets to B destined for the pp=
p=20
interface which now no longer exists. B then has no option but to route t=
hese=20
packets via its default gateway. Now when a new dialup is made from B, th=
e=20
ppp interface is setup as well as its routes once again, but packets from=
 A=20
via B are still routed through the default gateway instead of across the =
ppp=20
interface, hence not allowing a connection from A to the machine B has=20
dialled.

I've delved into the kernel, and found that the function in_losing(inp) i=
n=20
netinet/in_pcb.c is being called and it prints the message RTM_LOSING: Ke=
rnel=20
Suspects Partitioning when running "route -n monitor". I've tried in vain=
 to=20
find where exactly the kernel makes the decision that these packets shoul=
d be=20
routed through the default gateway. It seems obvious to me that some reco=
rd=20
is kept by the kernel of where certain packets should be sent, and this i=
s=20
not being flushed after the ppp interface has come up.

Could someone tell me if this is a bug, and if so how do I fix it?

Any help would be most appreciated!

Thanks,
Brad