我在整个应用程序的不同模块中两次使用了scapy。但是,模块之一创建了一个新的multiprocessing.Process,并在其中进行了到网络名称空间的syscall(308)。此时,我需要重新加载scapy,以便它重新定义其conf以与新的流程环境保持一致。

例如,差异低于常规导入($ 1)和净名称空间导入($ 2)

0a1
> 0
2c3
< AS_resolver = <scapy.as_resolvers.AS_resolver_multi instance at 0x1af3c68>
---
> AS_resolver = <scapy.as_resolvers.AS_resolver_multi instance at 0x7f6cd218bc68>
22c23
< iface      = 'TR_BR'
---
> iface      = 'lo'
34c35
< neighbor   = Ether -> ARP Ether -> IPv6 Dot3 -> IP Ether -> Dot1Q Ether -> L...
---
> neighbor   = Ether -> LLC Ether -> ARP Ether -> IPv6 Ether -> Dot1Q Ether ->...
47c48
< route6     = Destination Next Hop iface src candidates fe80::/64 :: UNTR_BR ...
---
> route6     = Destination Next Hop iface src candidates ::1/128 :: lo ::1

最佳答案

解决了对以下内容的更改:

conf.iface = 'lo'
conf.route.resync()

10-04 11:47