Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

libnids patch

By: a guest on May 7th, 2012  |  syntax: Diff  |  size: 0.81 KB  |  hits: 42  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- libnids-1.24/src/libnids.c  2010-03-02 00:43:25.000000000 +0330
  2. +++ libnids-1.24-mine/src/libnids.c     2012-05-07 20:46:52.137492412 +0430
  3. @@ -688,6 +688,7 @@ int nids_run()
  4.      }
  5.      START_CAP_QUEUE_PROCESS_THREAD(); /* threading... */
  6.      pcap_loop(desc, -1, (pcap_handler) nids_pcap_handler, 0);
  7. +    return 0;
  8.      /* FIXME: will this code ever be called? Don't think so - mcree */
  9.      STOP_CAP_QUEUE_PROCESS_THREAD();
  10.      nids_exit();
  11. @@ -714,8 +715,10 @@ void nids_exit()
  12.      scan_exit();
  13.      strcpy(nids_errbuf, "loop: ");
  14.      strncat(nids_errbuf, pcap_geterr(desc), sizeof nids_errbuf - 7);
  15. -    if (!nids_params.pcap_desc)
  16. -        pcap_close(desc);
  17. +    if (!nids_params.pcap_desc) {
  18. +      pcap_breakloop(desc);
  19. +      pcap_close(desc);
  20. +    }
  21.      desc = NULL;
  22.  
  23.      free(ip_procs);