[1/2] contrib/m920x/m920x_parse.pl: stricter check when extracting firmware

Message ID 1356820628-24992-2-git-send-email-ospite@studenti.unina.it (mailing list archive)
State Accepted, archived
Headers

Commit Message

Antonio Ospite Dec. 29, 2012, 10:37 p.m. UTC
  Extract firmware only from the right messages, skip the other messages.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---
 contrib/m920x/m920x_parse.pl |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 contrib/m920x/m920x_parse.pl
  

Patch

diff --git a/contrib/m920x/m920x_parse.pl b/contrib/m920x/m920x_parse.pl
old mode 100644
new mode 100755
index b309250..a6ca80a
--- a/contrib/m920x/m920x_parse.pl
+++ b/contrib/m920x/m920x_parse.pl
@@ -195,8 +195,9 @@  if ($mode eq "fw") {
 			last;
 		}
 
+		my $is_fw_msg = $bytes[0] eq "40" && $bytes[1] eq "30";
 		my $len = hex($bytes[6] . $bytes[7]);
-		if ($len < 32) {
+		if (!$is_fw_msg || $len < 32) {
 			next;
 		}