Filter AARP gleaning on all DDP to our network
This commit is contained in:
parent
0dd647b14b
commit
94f375f256
1 changed files with 8 additions and 4 deletions
6
main.go
6
main.go
|
@ -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
|
||||||
|
// (If it's not our net, then it was routed from elsewhere, and
|
||||||
|
// we'd be filling the AMT with entries for a router.)
|
||||||
|
if ddpkt.SrcNet >= cfg.EtherTalk.NetStart && ddpkt.SrcNet <= cfg.EtherTalk.NetEnd {
|
||||||
srcAddr := ddp.Addr{Network: ddpkt.SrcNet, Node: ddpkt.SrcNode}
|
srcAddr := ddp.Addr{Network: ddpkt.SrcNet, Node: ddpkt.SrcNode}
|
||||||
aarpMachine.Learn(srcAddr, ethFrame.Src)
|
aarpMachine.Learn(srcAddr, ethFrame.Src)
|
||||||
// log.Printf("DDP: Gleaned that %d.%d -> %v", srcAddr.Network, srcAddr.Node, 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()
|
||||||
|
|
Loading…
Reference in a new issue