Patch by James Woodcock:
* enables user-mode packet filters in the pcap library. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25673 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
|
* James Woodcock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -111,6 +112,12 @@ pcap_inject_haiku(pcap_t *handle, const void *buffer, size_t size)
|
|||||||
static int
|
static int
|
||||||
pcap_setfilter_haiku(pcap_t *handle, struct bpf_program *filter)
|
pcap_setfilter_haiku(pcap_t *handle, struct bpf_program *filter)
|
||||||
{
|
{
|
||||||
|
// Make our private copy of the filter
|
||||||
|
if (install_bpf_program(handle, filter) < 0) {
|
||||||
|
// install_bpf_program() filled in errbuf
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// we don't support kernel filters at all
|
// we don't support kernel filters at all
|
||||||
handle->md.use_bpf = 0;
|
handle->md.use_bpf = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user