Thanks Arne and Eriberto. This is fixed now in Bit-Twist 2.0.
Sorry it took almost 2 years!

On Mon, Jun 7, 2010 at 8:18 PM, Eriberto <eribe...@eriberto.pro.br> wrote:

> Thanks a lot Arne! I am sending this reply to the upstream also.
>
> Addy, can you make available a new version for download?
>
> Regards,
>
> Eriberto - Brazil
>
>
>
> 2010/6/7 Arne Wichmann <a...@linux.de>:
>
>> Package: bittwist
>> Version: 1.1-1
>> Severity: normal
>>
>>
>> When trying to use bittwist to send captured packets using an
>> amd64-system it sent garbage. The affixed patch corrected this.
>>
>> -- snip --
>> diff -ru bittwist-1.1/src/bittwist.c bittwist-1.1-patched/src/**
>> bittwist.c
>> --- bittwist-1.1/src/bittwist.c 2010-02-19 09:16:54.000000000 +0100
>> +++ bittwist-1.1-patched/src/**bittwist.c 2010-04-19 17:37:45.000000000
>> +0200
>> @@ -190,7 +190,7 @@
>>  {
>>     FILE *fp; /* file pointer to trace file */
>>     struct pcap_file_header preamble;
>> -    struct pcap_pkthdr header;
>> +    struct pcap_sf_pkthdr header;
>>     int pkt_len; /* packet length to send */
>>     int ret;
>>     int i;
>> @@ -223,7 +223,10 @@
>>             error("fread(): error reading %s", trace_file);
>>
>>         /* copy timestamp for current packet */
>> -        memcpy(&cur_ts, &header.ts, sizeof(struct timeval));
>> +       struct pcap_timeval ptime;
>> +       memcpy(&ptime, &header.ts, sizeof(ptime));
>> +       cur_ts.tv_sec = ptime.tv_sec;
>> +       cur_ts.tv_usec = ptime.tv_usec;
>>
>>         if (len < 0)        /* captured length */
>>             pkt_len = header.caplen;
>> diff -ru bittwist-1.1/src/def.h bittwist-1.1-patched/src/def.h
>> --- bittwist-1.1/src/def.h      2010-02-19 09:16:54.000000000 +0100
>> +++ bittwist-1.1-patched/src/def.h      2010-04-19 17:35:39.000000000
>> +0200
>> @@ -43,6 +43,17 @@
>>  #endif
>>  #include <pcap.h>
>>
>> +struct pcap_timeval {
>> +    bpf_int32 tv_sec;           /* seconds */
>> +    bpf_int32 tv_usec;          /* microseconds */
>> +};
>> +
>> +struct pcap_sf_pkthdr {
>> +    struct pcap_timeval ts;     /* time stamp */
>> +    bpf_u_int32 caplen;         /* length of portion present */
>> +    bpf_u_int32 len;            /* length this packet (off wire) */
>> +};
>> +
>>  #define BITTWIST_VERSION    "1.1"
>>  #define BITTWISTE_VERSION   BITTWIST_VERSION
>>  #define BITTWISTB_VERSION   BITTWIST_VERSION
>>
>> -- System Information:
>> Debian Release: squeeze/sid
>>  APT prefers testing
>>  APT policy: (500, 'testing')
>> Architecture: amd64 (x86_64)
>>
>> Kernel: Linux 2.6.32-trunk-amd64 (SMP w/4 CPU cores)
>> Shell: /bin/sh linked to /bin/dash
>>
>> Versions of packages bittwist depends on:
>> ii  libc6                         2.10.2-6   Embedded GNU C Library:
>> Shared lib
>> ii  libpcap0.8                    1.0.0-6    system interface for
>> user-level pa
>>
>> Versions of packages bittwist recommends:
>> ii  tcpdump                       4.1.1-1    A powerful tool for network
>> monito
>>
>> Versions of packages bittwist suggests:
>> pn  wireshark                     <none>     (no description available)
>>
>> -- debconf information:
>>
>>
>>
>>
>>
>>
>

Reply via email to