On Mon, Nov 09, 2009 at 07:10:17PM +0100, Ondrej Zajicek wrote:
On Mon, Nov 09, 2009 at 07:57:01PM +0200, Eugene Perevyazko wrote:
Now I see that async alien routes are added, but not deleted. They are deleted only on rescan. Is sysdep/bsd/krt.c missing something related to async deleting of alien routes or is the patch faulty in some way?
Hmm, i don't know. It is possible that async deletion event handling is not implemented in BSD code.
I've traced the problem down to this condition in krt_read_rt() in sysdep/bsd/krt-sock.c: if (!(flags & RTF_UP)) { DBG("Down.\n"); return; } Shouldn't it be !(flags & RTF_DONE) ? Or maybe even check rtm.errno first? To show the details I used next commands: # route add 10.0.1.0/24 192.168.200.2 add net 10.0.1.0: gateway 192.168.200.2 # route delete 10.0.1.0/24 192.168.200.2 delete net 10.0.1.0: gateway 192.168.200.2 # route delete 10.0.1.0/24 192.168.200.2 route: writing to routing socket: No such process delete net 10.0.1.0: gateway 192.168.200.2: not in table # route add 10.0.1.0/24 192.168.200.2 add net 10.0.1.0: gateway 192.168.200.2 # route delete 10.0.1.0/24 delete net 10.0.1.0 # route delete 10.0.1.0/24 route: writing to routing socket: No such process delete net 10.0.1.0: not in table And here is what route monitor shows for them: # route monitor got message of size 132 on Tue Nov 10 13:21:18 2009 RTM_ADD: Add Route: len 132, pid: 25159, seq 1, errno 0, flags:<UP,GATEWAY,DONE,STATIC> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.1.0 192.168.200.2 (0) 0 ffff ff got message of size 132 on Tue Nov 10 13:21:30 2009 RTM_DELETE: Delete Route: len 132, pid: 25160, seq 1, errno 0, flags:<GATEWAY,DONE,STATIC> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.1.0 192.168.200.2 (255) ffff ffff ff got message of size 132 on Tue Nov 10 13:21:30 2009 RTM_DELETE: Delete Route: len 132, pid: 25161, seq 1, errno 3, flags:<UP,GATEWAY,STATIC> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.1.0 192.168.200.2 (0) 0 ffff ff got message of size 132 on Tue Nov 10 13:21:35 2009 RTM_ADD: Add Route: len 132, pid: 25162, seq 1, errno 0, flags:<UP,GATEWAY,DONE,STATIC> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.1.0 192.168.200.2 (0) 0 ffff ff got message of size 132 on Tue Nov 10 13:21:38 2009 RTM_DELETE: Delete Route: len 132, pid: 25163, seq 1, errno 0, flags:<GATEWAY,DONE,STATIC> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.1.0 192.168.200.2 (255) ffff ffff ff got message of size 116 on Tue Nov 10 13:21:39 2009 RTM_DELETE: Delete Route: len 116, pid: 25164, seq 1, errno 3, flags:<UP,GATEWAY,STATIC> locks: inits: sockaddrs: <DST,NETMASK> 10.0.1.0 (0) 0 ffff ff -- Eugene Perevyazko