frenetic-lang / frenetic

The Frenetic Programming Language and Runtime System
http://www.frenetic-lang.org/
Other
222 stars 52 forks source link

Bug in Learning Switch Application #619

Closed dShvetsov closed 2 years ago

dShvetsov commented 6 years ago

Hello. I found that, src/lang/python/frenetic/examples/learning.py has a bug.

In function switch_policy this line

60      return known_pol | Filter(unknown_pred) >> (SendToController("learning_controller") | flood(sw))

says that packet with unkown_pred will be flooded.

unknown_pred means unknown source mac, but you really need to flood unknown destination mac. Ye So I think the right way will be write following :

60      return known_pol | Filter(unknown_source) >> SendToController("learning_controller") | Filter(unknown_destination) >> flood(sw)