Hi,

On Wed, Feb 1, 2023 at 4:37 AM Lev Stipakov <lstipa...@gmail.com> wrote:

> Hi,
>
> I made a slightly different fix but then noticed your mail.
>
> Indeed the problem is that get/set_interface_metric fails,
> and we call FwpmEngineClose0 after updating the undo list. When
> openvpn process exits, we execute commands in undo list,
> and second call to FwpmEngineClose0 causes Access Violation
> inside WFP.
>
> Note that since get_interface_metric() fails, it sets
> interface_data->metric_v4
> to -1. In this case we should not restore metrics back (which will
> fail in any case).
> We have a very similar code (including metrics value check) just below
> which
> handles msg_del_block_dns. Can we factor it out into a separate function?
>

Good point.  I have a version that splits "add" and "delete" actions into
separate functions and does something like this.

Please take a look here:
https://github.com/selvanair/openvpn/tree/block-dns-fix
The add and delete functions are in that order (with a forward declaration)
only to make review easier (less changes with ignore-all-spaces), will move
the latter up if it looks okay.

That said, if you have a better fix, I'm ready to review it in lieu of this.

Thanks,

Selva
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to