Skip to content

Commit

Permalink
add judgement of dpid
Browse files Browse the repository at this point in the history
  • Loading branch information
muzixing committed May 23, 2016
1 parent 9a14f6c commit 807d9e3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ryu/app/multipath/multipath.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ def _packet_in_handler(self, ev):

if isinstance(ip_pkt, ipv4.ipv4):
self.logger.debug("IPV4 processing")
mac_to_port_table = self.mac_to_port.get(dpid)
if mac_to_port_table is None:
self.logger.info("Dpid is not in mac_to_port")
return

out_port = None
if eth.dst in self.mac_to_port[dpid]:
if eth.dst in mac_to_port_table:
if dpid == 1 and in_port == 1:
if self.FLAGS is True:
self.send_group_mod(datapath)
Expand All @@ -223,7 +228,7 @@ def _packet_in_handler(self, ev):
in_port, 2, msg.data)
else:
#Normal flows
out_port = self.mac_to_port[dpid][eth.dst]
out_port = mac_to_port_table[eth.dst]
actions = [parser.OFPActionOutput(out_port)]
match = parser.OFPMatch(in_port=in_port, eth_dst=eth.dst,
eth_type=eth.ethertype)
Expand Down

0 comments on commit 807d9e3

Please sign in to comment.