$ipaddr vs $netaddr
Jon Wilmoth
JWilmoth at starbucks.com
Tue Jan 20 22:37:25 UTC 2004
If the loginnetmask is 24, will get_netaddr will return nnn.nnn.nnn or
nnn.nnn.nnn.000? Perhaps I should rephrase the question as "is the
number of bits chopped or substituted?" If substituted, what's the
substitution value?
-----Original Message-----
From: developers-owner at bugzilla.org
[mailto:developers-owner at bugzilla.org] On Behalf Of David Miller
Sent: Tuesday, January 20, 2004 2:06 PM
To: developers at bugzilla.org
Subject: Re: $ipaddr vs $netaddr
On 1/20/2004 1:17 PM -0800, Jon Wilmoth wrote:
> What's the difference between these two variables?
>
> They are populated in the CGI.pl from 2.17.3 in the following manner.
>
> my $ipaddr = $ENV{'REMOTE_ADDR'};
> my $netaddr = get_netaddr($ipaddr);
get_netaddr uses the loginnetmask param to mask the address for the
allowed
subnet the user can access from and still keep their cookies. So if
your
loginnetmask is set to 24, get_netaddr will return the user's IP address
with the last 8 bits removed. If loginnetmask is 32, it'll return the
IP
address unchanged.
--
Dave Miller Project Leader, Bugzilla Bug Tracking System
http://www.justdave.net/ http://www.bugzilla.org/
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=jwilmoth@starbucks.com>
More information about the developers
mailing list