gpt4 book ai didi

python - 重新加载scapy conf

转载 作者:太空宇宙 更新时间:2023-11-04 01:06:24 26 4
gpt4 key购买 nike

我在整个应用程序的不同模块中使用了两次 scapy。然而,其中一个模块创建了一个新的 multiprocessing.Process 并在其中对网络 namespace 进行系统调用(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()

关于python - 重新加载scapy conf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30147441/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com