bridge.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:kuryr-kubernetes 作者: openstack 项目源码 文件源码
def connect(self, vif, ifname, netns):
        host_ifname = vif.vif_name

        with b_base.get_ipdb(netns) as c_ipdb:
            with c_ipdb.create(ifname=ifname, peer=host_ifname,
                               kind='veth') as c_iface:
                c_iface.mtu = vif.network.mtu
                c_iface.address = str(vif.address)
                c_iface.up()

            if netns:
                with c_ipdb.interfaces[host_ifname] as h_iface:
                    h_iface.net_ns_pid = os.getpid()

        with b_base.get_ipdb() as h_ipdb:
            with h_ipdb.interfaces[host_ifname] as h_iface:
                h_iface.mtu = vif.network.mtu
                h_iface.up()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号