Changeset 4c5bbfc


Ignore:
Timestamp:
12/06/18 09:36:29 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
d97dee9
Parents:
de8566f
git-author:
Jacob Van Walraven <jcv9@…> (11/30/18 14:50:34)
git-committer:
Jacob Van Walraven <jcv9@…> (12/06/18 09:36:29)
Message:

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.