[tor-commits] [ooni-probe/master] Use generic L3RawSocket rather than OS specific L3PacketSocket

art at torproject.org art at torproject.org
Fri Jan 3 13:29:42 UTC 2014


commit faec3c8cf6f319e5ec6257637ccad5b4de78b78a
Author: aagbsn <aagbsn at extc.org>
Date:   Fri Oct 18 12:32:19 2013 +0000

    Use generic L3RawSocket rather than OS specific L3PacketSocket
    
    Experimental: Seems to work in tests, but has not yet been tested
    on any platform other than Linux. Solves the problem reported in
    https://github.com/TheTorProject/ooni-probe/issues/214
---
 ooni/utils/txscapy.py |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ooni/utils/txscapy.py b/ooni/utils/txscapy.py
index a5bb841..bcb0ca2 100644
--- a/ooni/utils/txscapy.py
+++ b/ooni/utils/txscapy.py
@@ -10,6 +10,7 @@ from twisted.internet import defer, abstract
 from zope.interface import implements
 
 from scapy.config import conf
+from scapy.supersocket import L3RawSocket
 
 from ooni.utils import log
 from ooni.settings import config
@@ -129,9 +130,7 @@ class ScapyFactory(abstract.FileDescriptor):
         if interface == 'auto':
             interface = getDefaultIface()
         if not super_socket:
-            super_socket = conf.L3socket(iface=interface,
-                    promisc=True, filter='')
-            #super_socket = conf.L2socket(iface=interface)
+            super_socket = L3RawSocket(iface=interface, promisc=True)
 
         self.protocols = []
         fdesc._setCloseOnExec(super_socket.ins.fileno())





More information about the tor-commits mailing list