On Thu, Dec 01, 2016 at 01:23:52PM +0100, David Sommerseth wrote:
> > (What you can do is "peek at byte 0", which will always be the same
> > part of the netmask [network byte order!], and which might actually
> > make this easier to read .-) )
> You mean like this?
>     in_addr_t nmask = htonl(c->c2.push_ifconfig_remote_netmask);
>     if ( nmask[0] == 0xff )
>       {
>          ...

No :-) - if you htonl() it, you need to work with full words and 
0xff000000 etc. - but if you just peek at 

   ((uchar *)&c->c2.push_ifconfig_remote_netmask)[0]

you should get the first byte of the netmask, no matter what the 
host byte order is.  (I'm not absolutely sure it's [0], could be [3],
but in any case, since this is "network byte order", location *in 
memory* will not be host byte order dependent)

But right now I'm a bit too busy to properly think about this, and
would just postpone to 2.4.1 - it's really minor.


USENET is *not* the non-clickable part of WWW!
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: signature.asc
Description: PGP signature

Openvpn-devel mailing list

Reply via email to