Hi,

On Thu, Jun 25, 2020 at 01:31:39PM +0300, Lev Stipakov wrote:
>              case AF_INET:
>                  if (setsockopt
> -                        (sd, IPPROTO_IP, IP_MTU_DISCOVER, &mtu_type, 
> sizeof(mtu_type)))
> +                        (sd, IPPROTO_IP, IP_MTU_DISCOVER, (const char 
> *)&mtu_type, sizeof(mtu_type)))

If windows really needs a cast here, please cast to (void *).

Windows can then cast to "const char *" under the hood - which should be
warning free.  But for all other platforms, casting to "const char *" is
not a good change (other parts of socket.c use "void *" already today).

If you are touching the lines anway, please add sensible line wrapping, 
like:

            case AF_INET:
                if (setsockopt(sd, IPPROTO_IP, IP_MTU_DISCOVER, 
                               (void *) &mtu_type, sizeof(mtu_ type)))

and not this very weird style with wrapping after the function name.

(Whatever uncrustify might have been thinking, it's ugly)

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