Hi, On Thu, Mar 29, 2012 at 11:16:42AM +0200, Alon Bar-Lev wrote: > Use the following constants: > - METRIC_NOT_USED > - TUN_ADAPTER_INDEX_INVALID
3/4-ACK. ACK on the TUN_ADAPTER_INDEX_INVALID change. ACK on the METRIC_NOT_USED change for route_add_ipapi() - checked vs. CreateIpForwardEntry() documentation on http://msdn.microsoft.com/en-us/library/windows/desktop/aa365860(v=vs.85).aspx "A number of members of the MIB_IPFORWARDROW structure pointed to by the route parameter are not currently used by CreateIpForwardEntry. These members include dwForwardPolicy, dwForwardType, dwForwardAge, dwForwardNextHopAS, dwForwardMetric2, dwForwardMetric3, dwForwardMetric4, and dwForwardMetric5." (doesn't particularily tell whether they should be set to zero or to -1, for forward-compatibility, but having a constant "METRIC_NOT_USED" makes the code easier to understand, IMHO, without functional changes). I'm a bit unsure about that one: Hi, On Thu, Mar 29, 2012 at 11:16:42AM +0200, Alon Bar-Lev wrote: > Use the following constants: > - METRIC_NOT_USED > - TUN_ADAPTER_INDEX_INVALID 3/4-ACK. ACK on the TUN_ADAPTER_INDEX_INVALID change. ACK on the METRIC_NOT_USED change for route_add_ipapi() - checked vs. CreateIpForwardEntry() documentation on http://msdn.microsoft.com/en-us/library/windows/desktop/aa365860(v=vs.85).aspx "A number of members of the MIB_IPFORWARDROW structure pointed to by the route parameter are not currently used by CreateIpForwardEntry. These members include dwForwardPolicy, dwForwardType, dwForwardAge, dwForwardNextHopAS, dwForwardMetric2, dwForwardMetric3, dwForwardMetric4, and dwForwardMetric5." (doesn't particularily tell whether they should be set to zero or to -1, for forward-compatibility, but having a constant "METRIC_NOT_USED" makes the code easier to understand, IMHO, without functional changes). I'm a bit unsure about that one: > @@ -2098,7 +2102,7 @@ static const MIB_IPFORWARDROW * > get_default_gateway_row (const MIB_IPFORWARDTABLE *routes) > { > struct gc_arena gc = gc_new (); > - DWORD lowest_metric = ~0; > + DWORD lowest_metric = METRIC_NOT_USED; > const MIB_IPFORWARDROW *ret = NULL; > int i; > int best = -1; because it's not actually "METRIC_NOT_USED", but the WIN32 analog to the UINT_MAX patch in 1/4. So this change should not go in, but it should be initialized to "DWORD_MAX", whatever that is. So I'd propose to split this into two separate patches, with this particular chunked separated out. thanks, 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
pgpXLkpARZr0Q.pgp
Description: PGP signature