Repository navigation
Add some error checking to pcap_dump(). - #494
shane-kerr wants to merge 1 commit into
Conversation
|
This rebases on the current master branch fine after a trivial conflict resolution, but the pull request predates the "push into the contributor's branch" feature, so I cannot update it in place. In any case, the suggested change looks useful. |
Who thought that the pcap callback functions for The right fix is to add new routines where the callback can return a status code, and then a dump routine that does return an error code could be added and used with those routines. That could be done as part of the process of adding full pcapng support. (Note that changes that modify the API or ABI are not allowed.) |
|
This isn't a perfect fix, but it adds a comment with the rationale and an extra |
|
Merged as commit e6d1929, thank you. |
We noticed that pcap files were corrupted after a full disk event. This patch tries to help a bit.
Note that probably it would be better if
pcap_dump()returned an error code, rather than being a void function. The best way to transition to that might be to add a new function that returned an error, and hadpcap_dump()just call that and throw away the error code, then declarepcap_dump()deprecated in a future version of the ABI and ultimately removing it.Who thought a function that doesn't return an error code was a good idea? 😉