Revision: 2771
http://ipcop.svn.sourceforge.net/ipcop/?rev=2771&view=rev
Author: owes
Date: 2009-05-02 22:41:23 +0000 (Sat, 02 May 2009)
Log Message:
-----------
Fix sorting of fixed leases list.
Add test if fixed lease IP is in (active) green or blue network.
Modified Paths:
--------------
ipcop/trunk/html/cgi-bin/dhcp.cgi
Modified: ipcop/trunk/html/cgi-bin/dhcp.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/dhcp.cgi 2009-05-02 15:31:27 UTC (rev 2770)
+++ ipcop/trunk/html/cgi-bin/dhcp.cgi 2009-05-02 22:41:23 UTC (rev 2771)
@@ -16,7 +16,7 @@
# along with IPCop; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# (c) 2001-2008 The IPCop Team
+# (c) 2001-2009 The IPCop Team
#
# Over the years many people have changed and contributed to this file.
# Check CVS and SVN for specifics.
@@ -342,6 +342,28 @@
goto ERROR_SAVE_FIXED;
}
+ my $insubnet = 0;
+ # IP must be in green or blue network and dnsmasq must be active there
+ foreach $interface (@INTERFACEs) {
+ for ($counter = 1; $counter <= $netsettings{"${interface}_COUNT"};
$counter++) {
+ next if ($dhcpsettings{"ENABLED_${interface}_${counter}"} ne 'on');
+
+ if (&General::IpInSubnet($dhcpsettings{'FIXED_IP'},
+
$netsettings{"${interface}_${counter}_NETADDRESS"},
+
$netsettings{"${interface}_${counter}_NETMASK"})
+ ) {
+ $insubnet++;
+ }
+ }
+ }
+ if ($insubnet == 0) {
+ $errormessage = $Lang::tr{'invalid fixed ip address'};
+ goto ERROR_SAVE_FIXED;
+ }
+
+ # TODO: test for duplicate MAC addresses
+ # Duplicate MAC is OK, as long as the to be assigned IP addresses are in
different networks
+
if ($dhcpsettings{'KEY_FIXED'} ne '') {
# replace existing
@@ -829,10 +851,11 @@
elsif ($dhcpsettings{'SORT_FIXEDLEASELIST'} eq 'FIXEDMACRev') {
system "/usr/bin/sort -r -t ',' -k 1,1 /var/ipcop/dhcp/fixedleases -o
/var/ipcop/dhcp/fixedleases";
}
- elsif ($dhcpsettings{'SORT_FIXEDLEASELIST'} eq 'FIXEDIP') {
+ elsif ($dhcpsettings{'SORT_FIXEDLEASELIST'} eq 'FIXEDIPRev') {
system "/usr/bin/sort -r -n -t ',' -k 2,2 /var/ipcop/dhcp/fixedleases
-o /var/ipcop/dhcp/fixedleases";
}
- elsif ($dhcpsettings{'SORT_FIXEDLEASELIST'} eq 'FIXEDIPRev') {
+ else {
+ # FIXEDIP is also default when no sorting selected (yet)
system "/usr/bin/sort -n -t ',' -k 2,2 /var/ipcop/dhcp/fixedleases -o
/var/ipcop/dhcp/fixedleases";
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn