| skipped 453 lines |
454 | 454 | | uint32_t rm_rules_arr[50]; |
455 | 455 | | char string[500], *ch = string; |
456 | 456 | | int i; |
| 457 | + | int ret = 0; |
457 | 458 | | |
458 | 459 | | context_t *context = (context_t *) args; |
459 | 460 | | MUST_NOT_OCCUR( context == NULL, "args parameter must not be NULL"); //this must not happen |
| skipped 9 lines |
469 | 470 | | |
470 | 471 | | //if there is no interested information |
471 | 472 | | //TODO: to check if we still need to send timestamp/counter to mmt-sec? |
472 | | - | if( unlikely( msg == NULL )) |
473 | | - | return 1; |
| 473 | + | if( unlikely( msg == NULL )){ |
| 474 | + | goto __finish_security; |
| 475 | + | ret = 1; |
| 476 | + | } |
474 | 477 | | |
475 | 478 | | mmt_sec_process( context->sec_handler, msg ); |
476 | 479 | | |
| skipped 30 lines |
507 | 510 | | |
508 | 511 | | total_received_reports ++; |
509 | 512 | | |
510 | | - | return 0; |
| 513 | + | //when forwarding packet is enable |
| 514 | + | // we need to call this function to forward the current packet if it is not satisfied by any rule |
| 515 | + | __finish_security: |
| 516 | + | if( context->config->forward->is_enable ) |
| 517 | + | forward_packet_on_receiving_packet_after_rule_processing( ipacket, context->forward_context ); |
| 518 | + | |
| 519 | + | |
| 520 | + | return ret; |
511 | 521 | | } |
512 | 522 | | |
513 | 523 | | void live_capture_callback( u_char *user, const struct pcap_pkthdr *p_pkthdr, const u_char *data ){ |
| skipped 197 lines |