8
0
Files
perl-NetPacket/perl-NetPacket-bigendian.patch
Stephan Kulow 8ef6092460 Accepting request 202119 from home:k0da:ppc
- USB is little endian, so we need to convert it on BigEndian
  platforms (perl-NetPacket-bigendian.patch)
  upstream commit fc0563f746c44387d77e70792628fe2a03628751

OBS-URL: https://build.opensuse.org/request/show/202119
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-NetPacket?expand=0&rev=11
2013-10-04 09:09:54 +00:00

41 lines
1.6 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,14 +65,14 @@ 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);
@@ -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;
}