Changeset 71ff20e


Ignore:
Timestamp:
04/22/10 16:56:20 (11 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
6374f4e
Parents:
65c178a
Message:
  • traceanon now replaces checksums with zeroes - TODO: maybe re-calculate checksums to what they would be with the new IP addresses
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/traceanon/traceanon.c

    r74c5dd9 r71ff20e  
    208208        for(;;) {
    209209                struct libtrace_ip *ipptr;
     210                libtrace_udp_t *udp = NULL;
     211                libtrace_tcp_t *tcp = NULL;
     212
    210213                int psize;
    211214                psize = trace_read_packet(trace, packet);
     
    220223                ipptr = trace_get_ip(packet);
    221224
    222                 if (ipptr && (enc_source || enc_dest))
     225                if (ipptr && (enc_source || enc_dest)) {
    223226                        encrypt_ips(ipptr,enc_source,enc_dest);
     227                        ipptr->ip_sum = 0;
     228                }
     229
     230                /* Replace checksums so that IP encryption cannot be
     231                 * reversed */
     232
     233                /* XXX replace with nice use of trace_get_transport() */
     234
     235                udp = trace_get_udp(packet);
     236                if (udp && (enc_source || enc_dest)) {
     237                        udp->check = 0;
     238                }
     239
     240                tcp = trace_get_tcp(packet);
     241                if (tcp && (enc_source || enc_dest)) {
     242                        tcp->check = 0;
     243                }
    224244
    225245                /* TODO: Encrypt IP's in ARP packets */
Note: See TracChangeset for help on using the changeset viewer.