nxm: fix nxm to OFPMatch conversion

This fixes a bug that the conversion ignores dl_dst.

Soheil Hassas Yeganeh reported a problem about simple_isolation:

The problem is that the isolation service tries to install
flow-entries for a specific src and dst (in
SimpleIsolation._modflow_and_send_packet), but instead the nx match
code installs flow-entries only with src addresses and ignores the
dst.  So, when I boot multiple vms, only one of them is reachable.

For instance, assume that you have two VM's A and B. When a packet
comes from the gw to A, it installs "gw->A: A's port", but the acutal
installed rule is "gw: A's port". This works for A, but, when you boot
B, it tries to install "gw->B: B's port", but the acutal rule to be
installed is "gw: B's port".  So, it always connect the gateway to
only one VM at a time.

Reported-by: Soheil Hassas Yeganeh <soheil@cs.toronto.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Soheil Hassas Yeganeh <soheil@cs.toronto.edu>
This commit is contained in:
FUJITA Tomonori 2012-07-13 16:43:18 +09:00
parent d73680f303
commit 323610d21f

View File

@ -297,6 +297,10 @@ class ClsRule(object):
if self.wc.dl_dst_mask:
return ofproto_v1_0.NXFF_NXM
# Masking DL_SRC is only supported by NXM
if self.wc.dl_src_mask:
return ofproto_v1_0.NXFF_NXM
# ECN is only supported by NXM
if not self.wc.wildcards & FWW_NW_ECN:
return ofproto_v1_0.NXFF_NXM
@ -313,7 +317,7 @@ class ClsRule(object):
if self.flow.dl_src != mac.DONTCARE:
wildcards &= ~ofproto.OFPFW_DL_SRC
if self.wc.dl_dst_mask:
if self.flow.dl_dst != mac.DONTCARE:
wildcards &= ~ofproto.OFPFW_DL_DST
if not self.wc.wildcards & FWW_DL_TYPE: