Hi,

close, but NAK, due to...

On Mon, Jul 11, 2022 at 10:10:19AM +0200, Antonio Quartulli wrote:
> This new API can be used to retrieve the type of a specific interface.
> It's mostly platform dependant, but right now expected values are
> "ovpn-dco", "tun" or "tap".
> 
> Other values are possible too, but they are not of interest to us.
> 
> This commit also extends the networking unit-test by using the newly
> introduced API in conjunction with iface_new and iface_del.
> 
> The t_next.sh script has been slightly adapted to allow running these
> tests in standalone (as they don't require any iproute2 counterpart).

Typo: t_net.sh (but this is not the crucial bit).

> +int
> +net_iface_type(openvpn_net_ctx_t *ctx, const char *iface,
> +               char type[IFACE_TYPE_LEN_MAX])
> +{
> +    struct sitnl_link_req req = { };
> +    int ifindex = if_nametoindex(iface);
> +
> +    if (!ifindex)
> +    {
> +        return errno;
> +    }

I think this violates the "errors are returned as negative errno" function 
contract (and this is a code change, I won't "fix this on the fly").

> +for i in $(seq $(($LAST_AUTO_TEST + 1)) ${LAST_TEST}); do

Does $(( $A + 1 )) work in POSIX shells?

t_net.sh currenty requires bash, but I wonder if this is really needed,
and a POSIX /bin/sh would do the job.


Also, while at it - maybe add a unit test for "this interface does not exist"
(as we need that functionality for the "--dev tun3" test)?

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

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

Reply via email to