From 2a160ed8a417ac8d2f7aefa32db9046980362a2c Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 5 Mar 2010 23:01:51 +0000 Subject: [PATCH] chomp serial number to remove LF which ZTE send git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@247 836a5e1a-633d-0410-964b-294494ad4392 --- lib/CWMP/Request.pm | 1 + lib/CWMP/Store.pm | 1 + lib/CWMP/Vendor.pm | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/CWMP/Request.pm b/lib/CWMP/Request.pm index 99770fa..0cea935 100644 --- a/lib/CWMP/Request.pm +++ b/lib/CWMP/Request.pm @@ -31,6 +31,7 @@ our $rules = [ 'ID' => sub { my ($tag_name, $tag_hash, $context, $parent_data) = @_; $state->{ID} = $tag_hash->{_content}; + chomp( $state->{ID} ); }, 'DeviceId' => sub { diff --git a/lib/CWMP/Store.pm b/lib/CWMP/Store.pm index 6d9a784..c5b5da9 100644 --- a/lib/CWMP/Store.pm +++ b/lib/CWMP/Store.pm @@ -139,6 +139,7 @@ sub state_to_uid { my $uid = $state->{DeviceID}->{SerialNumber} || confess "no DeviceID.SerialNumber in ",dump( $state ); + chomp($uid); return $uid; } diff --git a/lib/CWMP/Vendor.pm b/lib/CWMP/Vendor.pm index e0cb1d3..fdbdc1e 100644 --- a/lib/CWMP/Vendor.pm +++ b/lib/CWMP/Vendor.pm @@ -59,6 +59,7 @@ sub state2serial { my $state = shift; my $serial = $state->{DeviceID}->{SerialNumber} || die "no DeviceID.SerialNumber in ",dump($state); + chomp($serial); my $ip = $state->{Parameter}->{'.ExternalIPAddress'} || $state->{Parameter}->{ -- 2.20.1