--- smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/chilli.conf/25listen.chilli_ip 2008-09-02 13:28:00.000000000 +0200 +++ smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/chilli.conf/25listen 2008-09-05 12:00:55.000000000 +0200 @@ -1,16 +1,8 @@ { # Compute the first IP of the network -my $net = $chilli{'net'} || '10.1.0.0/255.255.255.0'; -my @net = split(/\//,$net); -$net = $net[0]; -my @nums = split(/\./,$net); -my $i = 0; -my $chillip = ''; -foreach (@nums){ - $chillip .= $_."." if ($i ne '3'); - $chillip .= "1" if ($i eq '3'); - $i++; -} +our $net = $chilli{'net'} || '10.1.0.0/255.255.255.0'; +our chillip = NetAddr::IP->new($net) + 1; +$chillip = $net->addr; $OUT = "uamlisten $chillip\n"; --- smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/chilli.conf/00setup.chilli_ip 2008-09-05 11:58:45.000000000 +0200 +++ smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/chilli.conf/00setup 2008-09-05 11:59:00.000000000 +0200 @@ -0,0 +1,3 @@ +{ +use NetAddr::IP; +} --- smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/chilli.conf/55uamserver.chilli_ip 2008-09-02 13:36:44.000000000 +0200 +++ smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/chilli.conf/55uamserver 2008-09-05 12:01:30.000000000 +0200 @@ -1,16 +1,4 @@ { -# Compute the first IP of the network -my $net = $chilli{'net'} || '10.1.0.0/255.255.255.0'; -my @net = split(/\//,$net); -$net = $net[0]; -my @nums = split(/\./,$net); -my $i = 0; -my $chillip = ''; -foreach (@nums){ - $chillip .= $_."." if ($i ne '3'); - $chillip .= "1" if ($i eq '3'); - $i++; -} my $uamsecret = $chilli{'uamsecret'} || 'azerty'; --- smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/squid/squid.conf/15HTTPPortChilli.chilli_ip 2008-09-02 13:28:01.000000000 +0200 +++ smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/squid/squid.conf/15HTTPPortChilli 2008-09-05 12:02:47.000000000 +0200 @@ -1,18 +1,11 @@ { +use NetAddr::IP; +my $net = $chilli{'net'} || '10.1.0.0/255.255.255.0'; +my chillip = NetAddr::IP->new($net) + 1; +$chillip = $net->addr; + $OUT =''; if ($chilli{'status'} eq 'enabled'){ - # Compute the first IP of the network - my $net = $chilli{'net'} || '10.1.0.0/255.255.255.0'; - my @net = split(/\//,$net); - $net = $net[0]; - my @nums = split(/\./,$net); - my $i = 0; - my $chillip = ''; - foreach (@nums){ - $chillip .= $_."." if ($i ne '3'); - $chillip .= "1" if ($i eq '3'); - $i++; - } my $squidport = $squid{'TransparentPort'} || '3128'; $OUT = "http_port $chillip:$squidport\n"; }