If WAN connection goes down OpenVPN loses route and can not get it back

The last few days I have had some odd problems with OpenWRT (18.06.02), the latest is that if the WAN connection goes down the route for the OpenVPN client I am running to the distant OpenVPN server gets deleted from the routing table and is not restored when WAN comes back up, resulting in OpenVPN spitting out:

daemon.notice openvpn(custom_config)[8178]: Recursive routing detected, drop tun packet to [AF_INET](ip address of the server)

Based on OpenVPN's logs it kind of restarts itself (stating that it is using the same "TLS context") when this happens and then pausing before restarting again (but never removing or re-adding the routes) when it sees it still has a problem.

Manually restarting OpenVPN fixes the issue.

Does anyone know what is going on?

EDIT: I tried adding some static routes but OpenWRT deletes them when the WAN interface has to restart due to loss of PPPoE session, which points to it not being a problem with OpenVPN at all, but with OpenWRT not applying iptable rules when an interface restarts.

Hi,
do you see that the openvpn deamon see that the wan connection goes down an try to create the vpn tunnel again ?

Could you post your openvpn config ?

I have managed it "fix" the problem by removing persist-tun, but the real problem (that OpenWRT does not restore routes on interface restart, not even static routes as defined in /etc/config/network) remains.