On Sat, Jul 14, 2012 at 11:49:06AM +0900, FUJITA Tomonori wrote: > On Fri, 13 Jul 2012 14:44:41 +0900 > Simon Horman <[email protected]> wrote: > > > * In the case of ARP_SPA, ARP_TPA and IPV6_FLABEL a masked match should be > > used unless the mask is all ones. > > > > Previously a non-masked matched was used in the case were the mask was > > zero, leading to the value being unmasked, whereas in should be completely > > masked out. > > > > * An un-masked IPV6_FLABEL should internally use a mask of UINT32_MAX > > > > Signed-off-by: Simon Horman <[email protected]> > > > > --- > > > > v2: Set flabel in set_ipv6_flabel(). > > v1 incorecctly set it in set_ipv6_dst_masked() > > --- > > ryu/ofproto/ofproto_v1_2_parser.py | 20 ++++++++++---------- > > 1 file changed, 10 insertions(+), 10 deletions(-) > > Thanks, one minor comment. > > > > diff --git a/ryu/ofproto/ofproto_v1_2_parser.py > > b/ryu/ofproto/ofproto_v1_2_parser.py > > index 1f437d5..eb29b57 100644 > > --- a/ryu/ofproto/ofproto_v1_2_parser.py > > +++ b/ryu/ofproto/ofproto_v1_2_parser.py > > @@ -1558,17 +1558,17 @@ class OFPMatch(object): > > self.append_field(ofproto_v1_2.OXM_OF_ARP_OP, self.flow.arp_op) > > > > if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_ARP_SPA): > > - if self.wc.arp_spa_mask: > > - header = ofproto_v1_2.OXM_OF_ARP_SPA_W > > - else: > > + if self.wc.arp_spa_mask == UINT32_MAX: > > header = ofproto_v1_2.OXM_OF_ARP_SPA > > + else: > > + header = ofproto_v1_2.OXM_OF_ARP_SPA_W > > self.append_field(header, self.flow.arp_spa, > > self.wc.arp_spa_mask) > > > > if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_ARP_TPA): > > - if self.wc.arp_tpa_mask: > > - header = ofproto_v1_2.OXM_OF_ARP_TPA_W > > - else: > > + if self.wc.arp_tpa_mask == UINT32_MAX: > > header = ofproto_v1_2.OXM_OF_ARP_TPA > > + else: > > + header = ofproto_v1_2.OXM_OF_ARP_TPA_W > > self.append_field(header, self.flow.arp_tpa, > > self.wc.arp_tpa_mask) > > > > if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_ARP_SHA): > > @@ -1602,10 +1602,10 @@ class OFPMatch(object): > > self.wc.ipv6_dst_mask) > > > > if self.wc.ft_test(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL): > > - if self.wc.ipv6_flabel_mask: > > - header = ofproto_v1_2.OXM_OF_IPV6_FLABEL_W > > - else: > > + if self.wc.ipv6_flabel_mask == UINT32_MAX: > > header = ofproto_v1_2.OXM_OF_IPV6_FLABEL > > + else: > > + header = ofproto_v1_2.OXM_OF_IPV6_FLABEL_W > > self.append_field(header, self.flow.ipv6_flabel, > > self.wc.ipv6_flabel_mask) > > > > @@ -1830,7 +1830,7 @@ class OFPMatch(object): > > > > def set_ipv6_flabel(self, flabel): > > self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL) > > The above line can be removed?
I'm not entirely sure how ft_set()/ft_test() works, but ft_test(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL) is still used so it seems to me that the line above is still needed. > > > > - self.flow.ipv6_flabel = flabel > > + self.set_ipv6_flabel_masked(flabel, UINT32_MAX) > > > > def set_ipv6_flabel_masked(self, flabel, mask): > > self.wc.ft_set(ofproto_v1_2.OFPXMT_OFB_IPV6_FLABEL) > > -- > > 1.7.10.2.484.gcd07cc5 > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Ryu-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/ryu-devel > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
