我的包:IPOptions在scapy3.0.0和python3.5拋出錯誤
a=IP(src="30.1.1.2",dst="20.1.1.2",options=IPOption('\x83\x07\x04\x00\x00\x00\x00\x00'),)
我收到錯誤:
a=bytes(IP(src="30.1.1.2",dst="20.1.1.2",options=IPOption('\x83\x07\x04\x00\x00\x00\x00\x00'),))
Traceback (most recent call last):
File "/usr/lib/python3.4/code.py", line 90, in runcode exec(code, self.locals)
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/scapy/base_classes.py", line 197, in call
cls = cls.dispatch_hook(*args, **kargs)
File "/usr/local/lib/python3.4/dist-packages/scapy/layers/inet.py", line 161, in dispatch_hook
opt = pkt[0] & 0x1f
TypeError: unsupported operand type(s) for &: 'str' and 'int' –
錯誤>>> a = bytes(IP(src =「30.1.1.2」,dst =「20.1.1.2」,options = IPOption('\ x83 \ x07 \ x04 \ x00 \ x00 \ x00 \ x00 \ x00'))) Traceback (最新最後調用): 文件 「/usr/lib/python3.4/code.py」,行90,在runcode EXEC(代碼self.locals) 文件 「」,1號線,在 文件「/usr/local/lib/python3.4/dist-packages/scapy/base_classes.py」,第197行,在__call__中 cls = cls.dispatch_hook(* args,** kargs) 文件「/ usr/local /lib/python3.4/dist-packages/scapy/layers/inet.py「,第161行,在dispatch_hook中 opt = pkt [0]&0x1f TypeError:不支持的操作數類型爲&:'str'和'int' –
Muralidhar