新TAP测试

This commit is contained in:
黄思敏 2022-08-31 18:11:50 +08:00
parent e8e66b6143
commit b885839c09
2 changed files with 3 additions and 2 deletions

View File

@ -85,7 +85,7 @@ func NewNetTunnel() *NetTunnel {
switch frame.Ethertype() {
case ethernet.ARP:
log.Printf("bytes len: %d type: % x", len(rbuf), frame.Ethertype()) // 数据长度
log.Printf("bytes len: %d type(arp): % x", len(rbuf), frame.Ethertype()) // 数据长度
nt.clients.Range(func(key, value any) bool {
if key == nt.ipv4key {
return true
@ -97,7 +97,7 @@ func NewNetTunnel() *NetTunnel {
return true
})
case ethernet.IPv4:
log.Printf("bytes len: %d type: % x", len(rbuf), frame)
log.Printf("bytes len: %d type(ipv4): % x", len(rbuf), frame.Ethertype())
log.Println(len(frame))
}

View File

@ -97,6 +97,7 @@ func (cli *RPCClient) run() {
// Contact the server and print out its response.
buf.Reset()
Compress(buf, frames)
frames = nil
// 发到对面的网卡
err = stream.Send(&gen.Request{