测试
This commit is contained in:
parent
a6adfa133e
commit
2722c58122
11
tap.go
11
tap.go
|
@ -7,6 +7,7 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os/exec"
|
||||
gen "slimming/proto/gen"
|
||||
"strings"
|
||||
|
@ -159,11 +160,17 @@ func (nc *NetCard) runRead() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if rframe.Ethertype() != ethernet.IPv4 {
|
||||
continue
|
||||
}
|
||||
|
||||
log.Println(net.IP(rframe.Destination()).String())
|
||||
|
||||
var buffer *[][]byte
|
||||
if buffer, ok = bytesMap[rframe.Destination().String()]; !ok {
|
||||
if buffer, ok = bytesMap[net.IP(rframe.Destination()).String()]; !ok {
|
||||
mbuffer := make([][]byte, 100)
|
||||
buffer = &mbuffer
|
||||
bytesMap[rframe.Destination().String()] = buffer
|
||||
bytesMap[net.IP(rframe.Destination()).String()] = buffer
|
||||
}
|
||||
|
||||
rframe = rframe[:n]
|
||||
|
|
Loading…
Reference in New Issue
Block a user