sophsec/ffi-pcap — pull request #8 by bubbadean123 (2012-10-24 20:19:39+00:00)
Title: Signal trap replacement in lib/ffi/pcap/capture_wrapper.rb

Previously, the CaptureWrapper#initialize method defined signal traps for INT and TERM which meant that the most recently initialized capture_wrapper object would be the one to handle those signals.

This caused some weird behavior when sending a TERM to the overall app that implemented capture wrappers when a pcap device had already been closed since it would throw a standard error when handling the TERM signal.

I'm not sure if this is even actively developed anymore (been 2 years since the last release), but I figured I'd throw it out there for the heck of it. Let me know what you think.

All the specs pass except for the FileHeader specs which fail due to IndexErrors both in cloned master and my branch. I'm not sure how to fix it exactly, and suspect its environmental... Error output below:

```ruby
1) FFI::PCap::FileHeader should parse a pcap file correctly
Failure/Error: described_class.new(:raw => File.read(PCAP_TESTFILE))
IndexError:
Memory access offset=0 size=875 is out of bounds
# ./spec/file_header_spec.rb:5:in `new'
# ./spec/file_header_spec.rb:5:in `block (2 levels) in '
# ./spec/file_header_spec.rb:9:in `block (2 levels) in '
```