重新加载scapy conf

时间:2015-05-10 03:33:01

标签: python module scapy system-calls

我在整个应用程序中使用scapy两次不同的模块。然而,其中一个模块创建了一个新的multiprocessing.Process,并在此内部将一个系统调用(308)转换为网络命名空间。此时我需要重新加载scapy,以便重新定义其conf以与新的进程环境保持一致。

例如,diff低于正常导入($ 1)和net命名空间导入($ 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

1 个答案:

答案 0 :(得分:2)

解决方案改为:

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