Changeset d97dee9


Ignore:
Timestamp:
12/06/18 13:28:39 (2 years ago)
Author:
GitHub <noreply@…>
Branches:
develop
Children:
ffe6fae
Parents:
de8566f (diff), 4c5bbfc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Shane Alcock <salcock@…> (12/06/18 13:28:39)
git-committer:
GitHub <noreply@…> (12/06/18 13:28:39)
Message:

Merge pull request #82 from jacobvw/tracesplit

Reusing the original packet should prevent issue #60

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracesplit/tracesplit.c

    r47d4f8c r4c5bbfc  
    326326        if (jump) {
    327327            /* Skip headers */
    328             void *newpacket = perform_jump(*packet, jump);
     328            struct libtrace_packet_t *newpacket = perform_jump(*packet, jump);
    329329            if (newpacket) {
    330                 trace_destroy_packet(*packet);
    331                 *packet = newpacket;
     330                /* If an IP header was found on the nth layer down
     331                 * write out the packet  */
     332                if (trace_write_packet(output, newpacket)==-1) {
     333                    trace_perror_output(output,"write_packet");
     334                    return -1;
     335                }
     336                /* Then destroy the packet */
     337                trace_destroy_packet(newpacket);
    332338            }
    333             else /* Skip packet */
     339            else /* Skip packet - Payload ran out before getting to nth layer */
    334340                return 1;
    335         }
    336 
    337         if (trace_write_packet(output, *packet)==-1) {
     341        } else {
     342
     343            if (trace_write_packet(output, *packet)==-1) {
    338344                trace_perror_output(output,"write_packet");
    339345                return -1;
     346            }
    340347        }
    341348
Note: See TracChangeset for help on using the changeset viewer.