Issue Information
-
#001046
-
1 - Low
-
Invalid
Issue Confirmations
-
Yes (0)No (0)
Originally posted by theultramage
http://www.eathena.w...er&showbug=1046
Oh, and for some reason, when I was testing one linux server, which didn't have any matching subnet entries,
This post has been edited by theultramage: Feb 24 2008, 10:08 AM
http://www.eathena.w...er&showbug=1046
CODE
if( strcmpi(w1, "subnet") == 0 )
{
subnet[subnet_count].mask = str2ip(w2);
subnet[subnet_count].char_ip = str2ip(w3);
subnet[subnet_count].map_ip = str2ip(w4);
str2ip expects an ip addres in dotted notation, so it doesn't do any dns resolution; this means that the subnet config can't be used in a dynamic ip address situation.{
subnet[subnet_count].mask = str2ip(w2);
subnet[subnet_count].char_ip = str2ip(w3);
subnet[subnet_count].map_ip = str2ip(w4);
Oh, and for some reason, when I was testing one linux server, which didn't have any matching subnet entries,
CODE
int lan_subnetcheck(uint32 ip)
{
int i;
ARR_FIND( 0, subnet_count, i, (subnet[i].char_ip & subnet[i].mask) == (ip & subnet[i].mask) );
return ( i < subnet_count ) ? subnet[i].char_ip : 0;
}
...
subnet_char_ip = lan_subnetcheck(ipl); // Advanced subnet check [LuzZza]
was assigning '1' to the subnet_char_ip variable, instead of 0. I have no idea what that was about. It went away if I disabled -O2.{
int i;
ARR_FIND( 0, subnet_count, i, (subnet[i].char_ip & subnet[i].mask) == (ip & subnet[i].mask) );
return ( i < subnet_count ) ? subnet[i].char_ip : 0;
}
...
subnet_char_ip = lan_subnetcheck(ipl); // Advanced subnet check [LuzZza]
This post has been edited by theultramage: Feb 24 2008, 10:08 AM