Skip to content
Snippets Groups Projects
Commit 3983433a authored by Alexander Bluhm's avatar Alexander Bluhm
Browse files

Use special code path for OpenBSD in sndrcv.

On OpenBSD use the non-blocking recv() after select() in sndrcv().
That was already done for FreeBSD and Darwin.  This fixes sniffing
on real hardware with libdnet backend.
parent cbcb87b2
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ import errno ...@@ -11,7 +11,7 @@ import errno
import cPickle,os,sys,time,subprocess import cPickle,os,sys,time,subprocess
import itertools import itertools
from select import select from select import select
from scapy.arch.consts import DARWIN, FREEBSD from scapy.arch.consts import DARWIN, FREEBSD, OPENBSD
from scapy.data import * from scapy.data import *
from scapy.config import conf from scapy.config import conf
from scapy.packet import Gen from scapy.packet import Gen
...@@ -132,7 +132,7 @@ def sndrcv(pks, pkt, timeout = None, inter = 0, verbose=None, chainCC=0, retry=0 ...@@ -132,7 +132,7 @@ def sndrcv(pks, pkt, timeout = None, inter = 0, verbose=None, chainCC=0, retry=0
inp = bpf_select(inmask) inp = bpf_select(inmask)
if pks in inp: if pks in inp:
r = pks.recv() r = pks.recv()
elif not isinstance(pks, StreamSocket) and (FREEBSD or DARWIN): elif not isinstance(pks, StreamSocket) and (FREEBSD or DARWIN or OPENBSD):
inp, out, err = select(inmask,[],[], 0.05) inp, out, err = select(inmask,[],[], 0.05)
if len(inp) == 0 or pks in inp: if len(inp) == 0 or pks in inp:
r = pks.nonblock_recv() r = pks.nonblock_recv()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment