Ticket #128 (new defect)

Opened 3 months ago

Last modified 3 months ago

Session support broken in 2.0.0.5 beta

Reported by: ian@mahuron.org Assigned to: pbi
Priority: major Milestone:
Component: Scapy Version: 2.0.0.x
Keywords: Cc:

Description

Looks like cPickle is choking on the class instances route and neighbors, each of which contain members which cannot be pickled. I suspect this can be remedied with proper getstate() and setstate() in each. I'll hack on it a bit when I have a chance.

Cheers!

Python 2.5 (release25-maint, Jul 20 2008, 20:47:25) 
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2

imahuron@meh:~/Temp$ scapy -s foo
INFO: New session [foo]
Welcome to Scapy (2.0.0.5 beta)
>>> conf_dict=scapy.main.session['conf'].__dict__
>>> for k in conf_dict:
...   try:
...     p=cPickle.dumps(conf_dict[k], -1)
...   except:
...     print "%s pickle failed.  %s (%s)\n" % (k, sys.exc_type, sys.exc_value)
... 
route pickle failed.  <type 'exceptions.TypeError'> (expected string or Unicode object, NoneType found)

neighbor pickle failed.  <class 'cPickle.PicklingError'> (Can't pickle <type 'function'>: attribute lookup __builtin__.function failed)

Attachments

Change History

08/21/08 23:42:24 changed by anonymous

The Route instance was easy enough to work around. It appears you cannot pickle the member variable s which is a socket object (I decided not to dig into _why_ it will not pickle). Is this member actually used?

The Neighbor instance has no easy workaround. The resolver member contains lambdas which cannot be pickled. Working around this is a design decision so I leave this to the project developers.


Add/Change #128 (Session support broken in 2.0.0.5 beta)




Change Properties
Action