Changeset 244426f
- Timestamp:
- 12/04/12 10:59:50 (9 years ago)
- 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:
- fd87898
- Parents:
- e1f3b6b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_rt.c
re90d5a8 r244426f 105 105 libtrace_t *dummy_pcap; 106 106 libtrace_t *dummy_linux; 107 libtrace_t *dummy_bpf; 107 108 }; 108 109 … … 198 199 RT_INFO->dummy_pcap = NULL; 199 200 RT_INFO->dummy_linux = NULL; 201 RT_INFO->dummy_bpf = NULL; 200 202 RT_INFO->pkt_buffer = NULL; 201 203 RT_INFO->buf_current = NULL; … … 290 292 if (RT_INFO->dummy_linux) 291 293 trace_destroy_dead(RT_INFO->dummy_linux); 294 295 if (RT_INFO->dummy_bpf) 296 trace_destroy_dead(RT_INFO->dummy_bpf); 292 297 free(libtrace->format_data); 293 298 return 0; … … 402 407 } 403 408 409 if (packet->type > TRACE_RT_DATA_BPF && 410 packet->type < TRACE_RT_DATA_DLT_END) { 411 412 if (!RT_INFO->dummy_bpf) { 413 RT_INFO->dummy_bpf = trace_create_dead("bpf:-"); 414 /* This may fail on a non-BSD machine */ 415 if (trace_is_err(RT_INFO->dummy_bpf)) { 416 trace_perror(RT_INFO->dummy_bpf, "Creating dead bpf trace"); 417 return -1; 418 } 419 } 420 packet->trace = RT_INFO->dummy_bpf; 421 return 0; 422 } 423 404 424 switch (packet->type) { 405 425 case TRACE_RT_DUCK_2_4: … … 419 439 if (!RT_INFO->dummy_linux) { 420 440 RT_INFO->dummy_linux = trace_create_dead("int:"); 441 /* This may fail on a non-Linux machine */ 442 if (trace_is_err(RT_INFO->dummy_linux)) { 443 trace_perror(RT_INFO->dummy_linux, "Creating dead bpf trace"); 444 return -1; 445 } 421 446 } 422 447 packet->trace = RT_INFO->dummy_linux;
Note: See TracChangeset
for help on using the changeset viewer.