]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Handle bad ouis better and print hostnames better
authorShawn Routhier <sar@isc.org>
Wed, 20 Jan 2016 16:00:36 +0000 (08:00 -0800)
committerShawn Routhier <sar@isc.org>
Wed, 20 Jan 2016 16:00:36 +0000 (08:00 -0800)
Handle bad ouis better and print hostnames better in
the dhcp lease script

RELNOTES
contrib/dhcp-lease-list.pl

index 22889ec270c36874fccd4a98fc43b0dd52f84e33..ae7c1a74665e4c644f57be0117c13fa6c366d593 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -167,6 +167,10 @@ by Eric Young (eay@cryptsoft.com).
   Thanks to Bill Parker (wp02855 at gmail dot com) who identified this issue.
   [ISC-Bugs #41485]
 
+- Updated contrib/dhcp-lease-list.pl to handle garbage in the oui file better
+  and to print out the hostnames a bit better.
+  [ISC-Bugs #41288]
+
                        Changes since 4.3.3b1
 
 - None
index f7e8c0c3fe7fe650335e2becda2da0b763c94c79..3e6fd729491053cfde9872b1108c503a3ada2d2e 100644 (file)
@@ -15,6 +15,9 @@
 #
 # 2013-04-22 - added option to choose lease file, made manufacture information
 #              optional, sar
+#
+# 2016-01-19 - updated to better trim the manu string and output the hostnames, sar
+
 use strict;
 use warnings;
 use POSIX qw(strftime);
@@ -41,7 +44,7 @@ sub get_manufactorer_for_mac($) {
     if (defined $oui) {
        $manu = join('-', ($_[0] =~ /^(..):(..):(..):/));
        $manu = `grep -i '$manu' $oui | cut -f3`;
-       chomp($manu);
+       $manu =~ s/^\s+|\s+$//g;
     }
 
     return $manu;
@@ -142,7 +145,7 @@ sub output_leases() {
     }
     foreach (@leases) {
        if ($opt_format eq 'human') {
-          printf("%-19s%-16s%-15s%-20s%-20s\n",
+          printf("%-19s%-16s%-14.14s %-20s%-20s\n",
                  $_->{'mac'},       # MAC
                  $_->{'ip'},        # IP address
                  $_->{'hostname'},  # hostname