pkgsrc/net/scapy/patches/patch-aa

74 lines
2.8 KiB
Text

$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: