Hi

On Sat, Jan 21, 2023 at 10:52 AM Gert Doering <[email protected]> wrote:

> Hi,
>
> On Mon, Jan 16, 2023 at 02:48:09PM -0500, [email protected] wrote:
> > From: Selva Nair <[email protected]>
> >
> > - Set RL_DID_LOCAL only if the corresponding route addition
> >   succeeds. This is needed to preserve when the direct route to
> >   the vpn server preexists.
>
> While I think this is a good thing, the existing implementation does
> not look good - changing add_route() to return RTA_* sounds logical,
> and makes "return something meaningful from add_route3()" very easy,
> but the "check windows route installation success?" code paths relies
> on code like this...
>
>             ret = add_route(r, tt, flags, &rl->rgi, es, ctx) && ret;
>
> this still *works* with an "int" return, because RTA_ERROR is 0, and
> the "not flagged as error" codes are 1 and 2 - but I'm not sure if that
> was intentional or luck, and it makes reading the code harder.
>

Yes, pure luck --- I overlooked it..


>
> So maybe postpone *this* part of the patch to 2.7 to give us a bit
> more time to think about how the return code/logic should look like?
>

agreed.


>
>
> > - Ensure net_route_v4/v6_add/del() functions using iproute2 return
> >   error when route addition fails. Return value follows the same logic
> >   as corresponding functions using netlink though all failure reasons
> >   get the same error code of -1.
>
> This one is very straightforward, easily testable in itself, and could
> go in right away.
>

Will do a v2 with only this part.

Selva
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to