summaryrefslogtreecommitdiff
path: root/net/scapy/patches/patch-aa
blob: e1711136c664903ffd56c667ff0cacdd0ea40848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
$NetBSD: patch-aa,v 1.1.1.1 2005/08/10 13:54:58 drochner Exp $

--- scapy.py.orig	2005-08-09 20:30:34.000000000 +0200
+++ scapy.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#!/usr/pkg/bin/python2.3
 
 #############################################################################
 ##                                                                         ##
@@ -888,7 +888,7 @@ except ImportError:
 
 
 LINUX=sys.platform.startswith("linux")
-OPENBSD=sys.platform.startswith("openbsd")
+OPENBSD=sys.platform.startswith("openbsd") or sys.platform.startswith("netbsd")
 
 if LINUX:
     DNET=PCAP=0
@@ -1357,8 +1357,8 @@ if PCAP:
     def get_working_if():
         try:
             return pcap.lookupdev()
-        except pcap.pcapc.EXCEPTION:
-            return 'lo'
+        except:
+            return 'lo0'
 
     def attach_filter(s, filter):
         warning("attach_filter() should not be called in PCAP mode")
@@ -6298,9 +6298,10 @@ class L3dnetSocket(SuperSocket):
             warning("Unable to guess datalink type (interface=%s linktype=%i). Using Ethernet" % (self.iface, ll))
             cls = Ether
 
-        pkt = None
-        while pkt is None:  ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout
-            pkt = self.ins.next()[1]
+        trypkt = None
+        while trypkt is None:  ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout
+            trypkt = self.ins.next()
+	pkt = trypkt[1]
 
         try:
             pkt = cls(pkt)
@@ -6342,9 +6343,11 @@ class L2dnetSocket(SuperSocket):
             warning("Unable to guess datalink type (interface=%s linktype=%i). Using Ethernet" % (self.iface, ll))
             cls = Ether
 
-        pkt = None
-        while pkt is None:  ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout
-            pkt = self.ins.next()[1]
+        trypkt = None
+        while trypkt is None:  ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout
+            trypkt = self.ins.next()
+	pkt = trypkt[1]
+
         try:
             pkt = cls(pkt)
         except:
@@ -6399,9 +6402,11 @@ class L2pcapListenSocket(SuperSocket):
             warning("Unable to guess datalink type (interface=%s linktype=%i). Using Ethernet" % (self.iface, ll))
             cls = Ether
 
-        pkt = None
-        while pkt is None:  ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout
-            pkt = self.ins.next()[1]
+        trypkt = None
+        while trypkt is None:  ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout
+            trypkt = self.ins.next()
+	pkt = trypkt[1]
+
         try:
             pkt = cls(pkt)
         except: