forked from pool/perl-NetPacket
- Extend last change for 32-bit big endian OBS-URL: https://build.opensuse.org/request/show/203766 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-NetPacket?expand=0&rev=13
47 lines
1.7 KiB
Diff
47 lines
1.7 KiB
Diff
Index: NetPacket-1.4.1/lib/NetPacket/USBMon.pm
|
|
===================================================================
|
|
--- NetPacket-1.4.1.orig/lib/NetPacket/USBMon.pm
|
|
+++ NetPacket-1.4.1/lib/NetPacket/USBMon.pm
|
|
@@ -65,18 +65,18 @@ sub decode
|
|
my($id, $type, $xfer_type, $epnum, $devnum, $busnum, $flag_setup,
|
|
$flag_data, $ts_sec, $ts_usec, $status, $length, $len_cap,
|
|
$s, $interval, $start_frame, $xfer_flags, $ndesc, $rest) =
|
|
- unpack('a8CCCCSCCa8liIIa8llLLa*', $packet);
|
|
+ unpack('a8CCCCS<CCa8l<i<I<I<a8l<l<L<L<a*', $packet);
|
|
|
|
# Try to grok quads. We may loose some address information with 32-bit
|
|
# Perl parsing 64-bit captures, or timestamp after 2038. Still the best
|
|
# we can do.
|
|
eval {
|
|
- $id = unpack ('Q', $id);
|
|
- $ts_sec = unpack ('Q', $ts_sec);
|
|
+ $id = unpack ('Q<', $id);
|
|
+ $ts_sec = unpack ('Q<', $ts_sec);
|
|
};
|
|
if ($@) {
|
|
- ($id) = unpack ('LL', $id);
|
|
- ($ts_sec) = unpack ('LL', $ts_sec);
|
|
+ ($id) = unpack ('L<L<', $id);
|
|
+ ($ts_sec) = unpack ('L<L<', $ts_sec);
|
|
}
|
|
|
|
my $self = {
|
|
@@ -115,7 +115,7 @@ sub decode
|
|
|
|
if ($setup->{bmRequestType} & USB_TYPE_VENDOR) {
|
|
($setup->{wValue}, $setup->{wIndex},
|
|
- $setup->{wLength}) = unpack('S3', $rest);
|
|
+ $setup->{wLength}) = unpack('S<3', $rest);
|
|
} else {
|
|
# Unknown setup request;
|
|
$setup->{data} = $rest;
|
|
@@ -127,7 +127,7 @@ sub decode
|
|
# Isochronous descriptors
|
|
if ($self->{xfer_type} == USB_XFER_TYPE_ISO) {
|
|
my $iso = {};
|
|
- ($iso->{error_count}, $iso->{numdesc}) = unpack('ii', $s);
|
|
+ ($iso->{error_count}, $iso->{numdesc}) = unpack('i<i<', $s);
|
|
$self->{iso} = $iso;
|
|
}
|
|
|