Ticket #44 (new defect)

Opened 3 years ago

Last modified 17 months ago

Select() calls do not handle EINTR

Reported by: t3rmin4t0r Owned by: pbi
Priority: minor Milestone:
Component: Scapy Version:
Keywords: Cc: gopalv82@…

Description

None of the select() calls in scapy.py handles syscall interruptions.

The attached patch is workaround which lets me use scapy in my tools.

Attachments

scapy.patch (0.6 KB) - added by t3rmin4t0r 3 years ago.
replace select() with a custom loop with EINTR handling

Change History

Changed 3 years ago by t3rmin4t0r

replace select() with a custom loop with EINTR handling

Changed 3 years ago by pbi

  • priority changed from major to minor

Which use case need this ? How did you get an EINTR error ? What operating system ? Usually, except when playing with sigaction(), the kernel restart interrupted system calls by itself.

Changed 3 years ago by t3rmin4t0r

I'm using scapy in a hacked up python-twisted DNS server on linux-x86-smp (ubuntu edgy).

What it was supposed to do was to convert DNS requests into RARPs on LAN - but most OSes don't respond to RARP - but an ARP ping scan can do nearly the same.

I'll put up the entire code tomorrow (<100 lines).

Changed 3 years ago by t3rmin4t0r

I've put up the code at

 http://t3.dotgnu.info/code/dnsmac.tar.gz

to use, edit the dnsconfig.py to add a host/mac mapping and set iface to eth0/eth1. And run

dig @127.0.0.2 <host>

Sometimes it locks up, sometimes it just throws an EINTR. With the patch, it works.

Add/Change #44 (Select() calls do not handle EINTR)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from pbi. Next status will be 'new'
The owner will change from pbi to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.