remove explicit multicast detection

We don't need. Multicast addresses never appear as sources and hence
never end up in the peer_cache. And the router always broadcasts
frames with destination addresses that aren't in the peer cache.
This commit is contained in:
Matthias Radestock committed 2014-10-24 14:30:58 +01:00
1 parent 9b90e119e5
commit 83464a38eb
2 files changed
+5 -14

No files matched your search

+3 -2
View File
@@ -124,7 +124,8 @@ func (router *Router) handleCapturedPacket(frameData []byte, dec *EthernetDecode
frameLen := len(frameData)
frameCopy := make([]byte, frameLen, frameLen)
copy(frameCopy, frameData)
if !found || dec.BroadcastFrame() {
if !found {
return checkFrameTooBig(router.Ourself.Broadcast(df, frameCopy, dec))
} else {
return checkFrameTooBig(router.Ourself.Forward(dstPeer, df, frameCopy, dec))
@@ -287,7 +288,7 @@ func (router *Router) handleUDPPacketFunc(dec *EthernetDecoder, po PacketSink) F
checkWarn(po.WritePacket(frame))
dstPeer, found = router.Macs.Lookup(dec.eth.DstMAC)
if !found || dec.BroadcastFrame() || dstPeer != router.Ourself {
if !found || dstPeer != router.Ourself {
return checkFrameTooBig(router.Ourself.RelayBroadcast(srcPeer, df, frame, dec), srcPeer)
}