fdbased还是走不了环回啊

This commit is contained in:
impact-eintr
2022-12-30 11:00:56 +08:00
parent e7e3da0c62
commit 49c7cd2ff4
6 changed files with 43 additions and 9 deletions

View File

@@ -101,9 +101,6 @@ func (n *NIC) addAddressLocked(protocol tcpip.NetworkProtocolNumber, addr tcpip.
if err != nil {
return nil, err
}
logger.GetInstance().Info(logger.IP, func() {
log.Printf("基于[%d]协议 为 #%d 网卡 添加网络层实现 并绑定地址到: %s\n", netProto.Number(), n.id, ep.ID().LocalAddress)
})
// 获取网络层端的id 其实就是ip地址
id := *ep.ID()
@@ -133,6 +130,10 @@ func (n *NIC) addAddressLocked(protocol tcpip.NetworkProtocolNumber, addr tcpip.
// 注册该网络端
n.endpoints[id] = ref
logger.GetInstance().Info(logger.IP, func() {
log.Printf("基于[%d]协议 为 #%d 网卡 添加网络层实现 并绑定地址到: %s\n", netProto.Number(), n.id, ep.ID().LocalAddress)
})
l, ok := n.primary[protocol]
if !ok {
l = &ilist.List{}