[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Comment out what we would want to have



commit 17e73e2253cf27e6c2d21d11bf33bcedeb82d7a1
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Sat Nov 24 21:39:35 2012 +0100

    Comment out what we would want to have
    * Uncomment set close-on-exec on the socket file descriptor. Would not be
      useful in our case since we are not forking, but it's does not hurt to be
      safe.
    * This functionality does not work on windows based machines, but twisteds
      wrapper for it takes care of handling that.
---
 ooni/utils/txscapy.py |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/ooni/utils/txscapy.py b/ooni/utils/txscapy.py
index e41d649..432a987 100644
--- a/ooni/utils/txscapy.py
+++ b/ooni/utils/txscapy.py
@@ -25,9 +25,6 @@ from scapy.arch import pcapdnet
 
 from ooni.utils import log
 
-conf.use_pcap = True
-conf.use_dnet = True
-
 def getNetworksFromRoutes():
     from scapy.all import conf, ltoa, read_routes
     from ipaddr    import IPNetwork, IPAddress
@@ -60,13 +57,12 @@ class TXPcapWriter(PcapWriter):
 class ScapyProtocol(abstract.FileDescriptor):
     def __init__(self, interface, super_socket=None, timeout=5):
         abstract.FileDescriptor.__init__(self, reactor)
-        # By default we use the conf.L3socket
         if not super_socket:
-            super_socket = pcapdnet.L3dnetSocket(iface=interface)
-        print super_socket
-        log.msg("Creating layer 3 socket with interface %s" % interface)
+            # XXX this is what we would want
+            #super_socket = pcapdnet.L3dnetSocket(iface=interface)
+            super_socket = conf.L3Socket(iface=interface)
 
-        #fdesc._setCloseOnExec(super_socket.ins.fileno())
+        fdesc._setCloseOnExec(super_socket.ins.fileno())
         self.super_socket = super_socket
 
         self.interface = interface

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits