From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Hofmann To: development@lists.ipfire.org Subject: [PATCH] improve DHCP dynamic leases list usability Date: Mon, 19 Oct 2020 00:19:58 +0200 Message-ID: <3e1fa0ad-9391-362b-9b3e-550333dd565b@leo-andres.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6820659432619135952==" List-Id: --===============6820659432619135952== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Some users have complained that displaying the active and expired leases in o= ne unordered list is confusing. This patch improves the DHCP user interface by visually separating active and expired leases. The list is now sorted by acti= ve and expired leases and they are divided by a horizontal line. Sorting by IP/MAC/host/time and creating static leases remains unchanged. See forum topic for context: https://community.ipfire.org/t/dhcp-server-expir= ed-leases/ Signed-off-by: Leo-Andres Hofmann --- =C2=A0config/cfgroot/header.pl | 167 +++++++++++++++++++++++---------------- =C2=A01 file changed, 97 insertions(+), 70 deletions(-) diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 1046f5992..b5d153a55 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -403,88 +403,110 @@ sub PrintActualLeases =C2=A0$tr{'mac address'} =C2=A0$tr{'hostname'} =C2=A0$tr{'lease expires'} (local time d/m/y) -Add to fix leases +Add to fix leases =C2=A0 =C2=A0END =C2=A0; =C2=A0=C2=A0=C2=A0=C2=A0 open(LEASES,"/var/state/dhcp/dhcpd.leases") or die = "Can't open dhcpd.leases"; -=C2=A0=C2=A0=C2=A0 while ($line =3D ) { -=C2=A0=C2=A0=C2=A0 next if( $line =3D~ /^\s*#/ ); -=C2=A0=C2=A0=C2=A0 chomp($line); -=C2=A0=C2=A0=C2=A0 @temp =3D split (' ', $line); - -=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*lease/) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ip =3D $temp[1]; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #All field are not necessarily re= ad. Clear everything -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $endtime =3D 0; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ether =3D ""; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname =3D ""; -=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0 while (my $line =3D ) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 next if( $line =3D~ /^\s*#/ ); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 chomp($line); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @temp =3D split (' ', $line); + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*lease/) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ip =3D $= temp[1]; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #All fiel= d are not necessarily read. Clear everything +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $endtime = =3D 0; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $endtime_= print =3D ""; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $expired = =3D 0; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ether = =3D ""; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname= =3D ""; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*ends/) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $line =3D~ /(\d+)\/(\d+)\/(\d+) (= \d+):(\d+):(\d+)/; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $endtime =3D timegm($6, $5, $4, $= 3, $2 - 1, $1 - 1900); -=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*ends/) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $line =3D= ~ /(\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)/; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $endtime = =3D timegm($6, $5, $4, $3, $2 - 1, $1 - 1900); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($sec, $m= in, $hour, $mday, $mon, $year, $wday, $yday, $dst) =3D localtime($endtime); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $endtime_= print =3D sprintf ("%02d/%02d/%d %02d:%02d:%02d",$mday,$mon+1,$year+1900,$hou= r,$min,$sec); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $expired = =3D $endtime < time(); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*hardware ethernet/) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ether =3D $temp[2]; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ether =3D~ s/;//g; -=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*hardware ethe= rnet/) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ether = =3D $temp[2]; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ether = =3D~ s/;//g; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*client-hostname/) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname =3D "$temp[1] $temp[2] = $temp[3]"; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname =3D~ s/;//g; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname =3D~ s/\"//g; -=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($line =3D~ /^\s*client-hostna= me/) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname= =3D "$temp[1] $temp[2] $temp[3]"; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname= =3D~ s/;//g; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname= =3D~ s/\"//g; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 if ($line eq "}") { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @record =3D ('IPADDR',$ip,'ENDTIM= E',$endtime,'ETHER',$ether,'HOSTNAME',$hostname); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $record = =3D {};=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # create a reference to empty hash -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 %{$record} =3D @record;=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # populate that hash w= ith @record -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $entries{$record->{'IPADDR'}} =3D= $record;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # add this to a hash of hashes -=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($line eq "}") { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @record = =3D ('IPADDR',$ip,'ENDTIME',$endtime,'ETHER',$ether,'HOSTNAME',$hostname,'end= time_print',$endtime_print,'expired',$expired); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $record = =3D {};=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # create a reference to empty hash +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 %{$record= } =3D @record;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #= populate that hash with @record +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $entries{= $record->{'IPADDR'}} =3D $record;=C2=A0=C2=A0=C2=A0 # add this to a hash of h= ashes +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 close(LEASES); =C2=A0=C2=A0=C2=A0=C2=A0 my $id =3D 0; -=C2=A0=C2=A0=C2=A0 my $col=3D""; +=C2=A0=C2=A0=C2=A0 my $col =3D ""; +=C2=A0=C2=A0=C2=A0 my $separator_printed =3D 0; =C2=A0=C2=A0=C2=A0=C2=A0 foreach my $key (sort leasesort keys %entries) { -=C2=A0=C2=A0=C2=A0 print "
\n"; -=C2=A0=C2=A0=C2=A0 my $hostname =3D &cleanhtml($entries{$key}->{HOSTNAME},"y= "); - -=C2=A0=C2=A0=C2=A0 if ($id % 2) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print ""; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $col=3D"bgcolor=3D'$table1colour'= "; -=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 else { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print ""; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $col=3D"bgcolor=3D'$table2colour'= "; -=C2=A0=C2=A0=C2=A0 } - -=C2=A0=C2=A0=C2=A0 print <{HOSTNAME},"y"); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 my $hostname_print =3D $hostname; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if($hostname_print eq "") { #prin= t blank space if no hostname is found +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $hostname= _print =3D "   "; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # separate active and expired lea= ses with a horizontal line +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(($entries{$key}->{expired}) &&= ($separator_printed =3D=3D 0)) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $separato= r_printed =3D 1; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($id %= 2) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print "
\n"; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print "
\n"; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $id++; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print "\n"; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($id % 2) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print ""; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $col=3D"b= gcolor=3D'$table1colour'"; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print ""; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $col=3D"b= gcolor=3D'$table2colour'"; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if($entries{$key}->{expired}) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print <{IPADDR}' />$entries{$key}->{IPADDR}<= /td> +{ETHER}' />$entries{$key}->{ETHER} +$hostname_print +$entries{$key}->{endtime_print} +END +; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print <{IPADDR}' />$entries{$key}->{IPADDR} =C2=A0{ETHER}' />$entries{$key}->{ETHER} - $hostname - +$hostname_print +$entries{$key}->{endtime_print} =C2=A0END -; - -=C2=A0=C2=A0=C2=A0 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $ds= t) =3D localtime ($entries{$key}->{ENDTIME}); -=C2=A0=C2=A0=C2=A0 $enddate =3D sprintf ("%02d/%02d/%d %02d:%02d:%02d",$mday= ,$mon+1,$year+1900,$hour,$min,$sec); - -=C2=A0=C2=A0=C2=A0 if ($entries{$key}->{ENDTIME} < time() ){ -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print "$enddate"; -=C2=A0=C2=A0=C2=A0 } else { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print "$enddate"; -=C2=A0=C2=A0=C2=A0 } -=C2=A0=C2=A0=C2=A0 print < - +; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print < + =C2=A0END -; -=C2=A0=C2=A0=C2=A0 $id++; -=C2=A0=C2=A0=C2=A0 } +; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $id++; +=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 print ""; =C2=A0=C2=A0=C2=A0=C2=A0 &closebox(); @@ -499,11 +521,14 @@ sub leasesort { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($qs eq 'IPADDR') { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @a = =3D split(/\./,$entries{$a}->{$qs}); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @b = =3D split(/\./,$entries{$b}->{$qs}); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $entries{= $a}->{'expired'} <=3D> $entries{$b}->{'expired'} || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($b= [0]<=3D>$a[0]) || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($b= [1]<=3D>$a[1]) || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($b= [2]<=3D>$a[2]) || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($b= [3]<=3D>$a[3]); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $entries{= $a}->{'expired'} <=3D> $entries{$b}->{'expired'} || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $en= tries{$b}->{$qs} cmp $entries{$a}->{$qs}; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 } @@ -511,15 +536,17 @@ sub leasesort { =C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $qs=3D$dhcpsettings{'SORT_L= EASELIST'}; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ($qs eq 'IPADDR') { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @a =3D split(/\./,$entries{$a}->{= $qs}); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @a =3D sp= lit(/\./,$entries{$a}->{$qs}); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @b = =3D split(/\./,$entries{$b}->{$qs}); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $entries{= $a}->{'expired'} <=3D> $entries{$b}->{'expired'} || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($a= [0]<=3D>$b[0]) || -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($a[1]<=3D>$b[1]) || -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($a[2]<=3D>$b[2]) || +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($a[1]<= =3D>$b[1]) || +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($a[2]<= =3D>$b[2]) || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ($a= [3]<=3D>$b[3]); -=C2=A0=C2=A0=C2=A0 }else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $entries{= $a}->{'expired'} <=3D> $entries{$b}->{'expired'} || =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $en= tries{$a}->{$qs} cmp $entries{$b}->{$qs}; -=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0} --===============6820659432619135952==--