I am using more than few OpenBSD routers ( n > 20). So I first create ospf between them (instead of static routes) and it works fine. That is ospf on WAN interfaces, it is not ospf for my LAN networks ie my WAN is area 0.0.0.0.

Now I want to use IPsec between all that routers. But behaviour of ipsec is strange. After rebooting routers, some SA are OK, some other are not.