python脚本在调用send()函数时引发异常。这是因为select()在解析目标IP的MAC地址时接收到EINTR信号。如果这是一个已知问题或是否有针对此问题的解决方法,有人可以告诉我吗?
要进一步调试,当捕获异常并再次调用select()时,它不会再次引发异常。
File "/usr/lib/python2.7/site-packages/scapy/sendrecv.py", line 251, in send
__gen_send(conf.L3socket(*args, **kargs), x, inter=inter, loop=loop, count=count,verbose=verbose, realtime=realtime)
File "/usr/lib/python2.7/site-packages/scapy/sendrecv.py", line 234, in __gen_send
s.send(p)
File "/usr/lib/python2.7/site-packages/scapy/arch/linux.py", line 395, in send
sx = str(ll(x))
File "/usr/lib/python2.7/site-packages/scapy/packet.py", line 268, in str
return self.build()
File "/usr/lib/python2.7/site-packages/scapy/packet.py", line 330, in build
p = self.do_build()
File "/usr/lib/python2.7/site-packages/scapy/packet.py", line 319, in do_build
pkt = self.self_build()
File "/usr/lib/python2.7/site-packages/scapy/packet.py", line 310, in self_build
p = f.addfield(self, p, val)
File "/usr/lib/python2.7/site-packages/scapy/fields.py", line 70, in addfield
return s+struct.pack(self.fmt, self.i2m(pkt,val))
File "/usr/lib/python2.7/site-packages/scapy/layers/l2.py", line 95, in i2m
return MACField.i2m(self, pkt, self.i2h(pkt, x))
File "/usr/lib/python2.7/site-packages/scapy/layers/l2.py", line 89, in i2h
x = conf.neighbor.resolve(pkt,pkt.payload)
File "/usr/lib/python2.7/site-packages/scapy/layers/l2.py", line 38, in resolve
return self.resolvers[k](l2inst,l3inst)
File "/usr/lib/python2.7/site-packages/scapy/layers/inet.py", line 732, in <lambda>
conf.neighbor.register_l3(Ether, IP, lambda l2,l3: getmacbyip(l3.dst))
File "/usr/lib/python2.7/site-packages/scapy/layers/l2.py", line 73, in getmacbyip
nofilter=1)
File "/usr/lib/python2.7/site-packages/scapy/sendrecv.py", line 375, in srp1
a,b=srp(*args,**kargs)
File "/usr/lib/python2.7/site-packages/scapy/sendrecv.py", line 358, in srp
a,b=sndrcv(s ,x,*args,**kargs)
File "/usr/lib/python2.7/site-packages/scapy/sendrecv.py", line 129, in sndrcv
inp, out, err = select(inmask,[],[], remaintime)
error: (4, 'Interrupted system call')