From ec7123d0118919b2cdb9e9f24a8a46c5cd56e2eb Mon Sep 17 00:00:00 2001
From: Srini Seetharaman <srini.seetharaman@gmail.com>
Date: Sun, 5 Jan 2014 10:12:55 -0800
Subject: [PATCH] Setting highest rule priority to LLDP packets in topology
 discovery

Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
---
 ryu/topology/switches.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 3fda046..7a2da6d 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -546,7 +546,8 @@ class Switches(app_manager.RyuApp):
                         ofproto.OFPP_CONTROLLER, self.LLDP_PACKET_LEN)]
                     dp.send_flow_mod(
                         rule=rule, cookie=0, command=ofproto.OFPFC_ADD,
-                        idle_timeout=0, hard_timeout=0, actions=actions)
+                        idle_timeout=0, hard_timeout=0, actions=actions,
+                        priority=0xFFFF)
                 elif ofproto.OFP_VERSION == ofproto_v1_3.OFP_VERSION:
                     match = ofproto_parser.OFPMatch(
                         eth_type=ETH_TYPE_LLDP,
@@ -561,7 +562,8 @@ class Switches(app_manager.RyuApp):
                             ofproto.OFPIT_APPLY_ACTIONS, actions)]
                     mod = parser.OFPFlowMod(datapath=dp, match=match,
                                             idle_timeout=0, hard_timeout=0,
-                                            instructions=inst)
+                                            instructions=inst,
+                                            priority=0xFFFF)
                     dp.send_msg(mod)
                 else:
                     LOG.error('cannot install flow. unsupported version. %x',
-- 
1.7.9

