Hi, On Wed, Nov 30, 2016 at 11:41:27PM +0100, David Sommerseth wrote: > + if ((c->options.topology == TOP_SUBNET || c->options.topology == > TOP_NET30) > + && (c->c2.push_ifconfig_remote_netmask & 0xff000000) != 0xff000000)
Are you sure of that? I would assume that this is stored in network byte order (as it's an in_addr_t) so you can't directly compare it to a number but need to run through ntohl() first. On *intel* it might end up being the same, but code dealing with IPv4 addresses and ports always needs to be checked on both endiannesses. Some random code I just found in a BSD header file does it that way: #define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ #define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) ... so it certainly needs the htonl() (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 .-) ) gert -- USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany g...@greenie.muc.de fax: +49-89-35655025 g...@net.informatik.tu-muenchen.de
signature.asc
Description: PGP signature
------------------------------------------------------------------------------
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel