When packet_in_filter discards a packet, it is always logging. However,
it may be felt noisy.

Signed-off-by: Satoshi Kobayashi <[email protected]>
---
 ryu/lib/ofp_pktinfilter.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ryu/lib/ofp_pktinfilter.py b/ryu/lib/ofp_pktinfilter.py
index a84f7bb..8f69d17 100644
--- a/ryu/lib/ofp_pktinfilter.py
+++ b/ryu/lib/ofp_pktinfilter.py
@@ -23,12 +23,13 @@ from ryu.lib.packet import packet
 LOG = logging.getLogger(__name__)
 
 
-def packet_in_filter(cls, args=None):
+def packet_in_filter(cls, args=None, logging=False):
     def _packet_in_filter(packet_in_handler):
         def __packet_in_filter(self, ev):
             pkt = packet.Packet(ev.msg.data)
             if not packet_in_handler.pkt_in_filter.filter(pkt):
-                LOG.debug('The packet is discarded by %s: %s' % (cls, pkt))
+                if logging:
+                    LOG.debug('The packet is discarded by %s: %s' % (cls, pkt))
                 return
             return packet_in_handler(self, ev)
         pkt_in_filter = cls(args)
-- 
1.8.5.2 (Apple Git-48)


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to