Filter AARP gleaning on all DDP to our network

This commit is contained in:
Josh Deprez 2024-04-27 16:42:12 +10:00
parent 0dd647b14b
commit 94f375f256
Signed by: josh
SSH key fingerprint: SHA256:zZji7w1Ilh2RuUpbQcqkLPrqmRwpiCSycbF2EfKm6Kw

12
main.go
View file

@ -410,10 +410,14 @@ func main() {
ddpkt.DstNet, ddpkt.DstNode, ddpkt.DstSocket, ddpkt.DstNet, ddpkt.DstNode, ddpkt.DstSocket,
ddpkt.Proto, len(ddpkt.Data)) ddpkt.Proto, len(ddpkt.Data))
// Glean address info for AMT // Glean address info for AMT, but only if SrcNet is our net
srcAddr := ddp.Addr{Network: ddpkt.SrcNet, Node: ddpkt.SrcNode} // (If it's not our net, then it was routed from elsewhere, and
aarpMachine.Learn(srcAddr, ethFrame.Src) // we'd be filling the AMT with entries for a router.)
// log.Printf("DDP: Gleaned that %d.%d -> %v", srcAddr.Network, srcAddr.Node, ethFrame.Src) if ddpkt.SrcNet >= cfg.EtherTalk.NetStart && ddpkt.SrcNet <= cfg.EtherTalk.NetEnd {
srcAddr := ddp.Addr{Network: ddpkt.SrcNet, Node: ddpkt.SrcNode}
aarpMachine.Learn(srcAddr, ethFrame.Src)
// log.Printf("DDP: Gleaned that %d.%d -> %v", srcAddr.Network, srcAddr.Node, ethFrame.Src)
}
// Packet for us? First, who am I? // Packet for us? First, who am I?
myAddr, ok := aarpMachine.Address() myAddr, ok := aarpMachine.Address()