fdbased 还是不太行

This commit is contained in:
impact-eintr
2022-12-29 19:05:16 +08:00
parent 7526791053
commit 162cca1079
10 changed files with 444 additions and 387 deletions

View File

@@ -1,6 +1,7 @@
package fdbased
import (
"fmt"
"log"
"netstack/logger"
"netstack/tcpip"
@@ -128,7 +129,7 @@ func (e *endpoint) WritePacket(r *stack.Route, hdr buffer.Prependable,
}
eth.Encode(ethHdr) // 将以太帧信息作为报文头编入
logger.GetInstance().Info(logger.ETH, func() {
log.Println("链路层写回以太报文")
log.Println("链路层写回以太报文 ", r.LocalAddress, " to ", r.RemoteAddress)
})
// 写入网卡中
if payload.Size() == 0 {