Bug#890815: libtext-dhcpleases-perl: vendor class identifier attribute should be handler

grin grin at grin.hu
Mon Feb 19 09:22:14 UTC 2018


Package: libtext-dhcpleases-perl
Version: 1.0-2
Severity: normal
Tags: upstream patch

Patch to handle vendor class attribute attached.
-------------- next part --------------
--- Text/DHCPLeases/Object.pm.orig	2015-06-06 10:59:27.000000000 +0200
+++ Text/DHCPLeases/Object.pm	2018-02-19 10:16:47.612390562 +0100
@@ -75,7 +75,8 @@
 'mclt'                    => '$',
 'ddns_rev_name'           => '$',
 'ddns_fwd_name'           => '$',
-'ddns_txt'                => '$'
+'ddns_txt'                => '$',
+'vendor_class_identifier' => '$',
 );
 
 =head1 CLASS METHODS
@@ -117,6 +118,7 @@
     dns_rev_name
     ddns_fwd_name
     ddns_txt
+    vendor_class_identifier
   Returns:
     New Text::DHCPLeases::Object object
   Examples:
@@ -149,6 +151,7 @@
   hardware ethernet 00:11:85:5d:4e:11;
   uid "\001\000\021\205]Nh";
   client-hostname "blah";
+  set vendor-class-identifier = "Tesla";
 }';
 
 my $lease_data = Text::DHCPLeases::Lease->parse($text);
@@ -238,6 +241,8 @@
 	    $obj{ddns_fwd_name} = $1;
 	}elsif (/set ddns-txt = \"(.*)\";/o){
 	    $obj{ddns_txt} = $1;
+        }elsif (/set vendor-class-identifier = \"(.*)\";/o){
+            $obj{vendor_class_identifier} = $1;
 	}else{
 	    carp "Text::DHCPLeases::Object::parse Error: Statement not recognized: '$_'\n";
 	}
@@ -287,6 +292,7 @@
     $out .= sprintf("  set ddns-rev-name = \"%s\";\n", $self->ddns_rev_name) if $self->ddns_rev_name;
     $out .= sprintf("  set ddns-txt = \"%s\";\n", $self->ddns_txt) if $self->ddns_txt;
     $out .= sprintf("  set ddns-fwd-name = \"%s\";\n", $self->ddns_fwd_name) if $self->ddns_fwd_name;
+    $out .= sprintf("  set vendor-class-identifier = \"%s\";\n", $self->vendor_class_identifier) if $self->vendor_class_identifier;
     $out .= sprintf("  fixed-address %s;\n", $self->fixed_address) if $self->fixed_address;
     $out .= sprintf("  abandoned;\n") if $self->abandoned;
     $out .= sprintf("  deleted;\n") if $self->abandoned;


More information about the pkg-perl-maintainers mailing list