示例#1
0
 def _validate_ethertype_and_protocol(self, rule):
     """Check if given ethertype and  protocol are valid or not"""
     if rule['protocol'] in [
             constants.PROTO_NAME_IPV6_ENCAP,
             constants.PROTO_NAME_IPV6_FRAG, constants.PROTO_NAME_IPV6_ICMP,
             constants.PROTO_NAME_IPV6_ICMP_LEGACY,
             constants.PROTO_NAME_IPV6_NONXT,
             constants.PROTO_NAME_IPV6_OPTS, constants.PROTO_NAME_IPV6_ROUTE
     ]:
         if rule['ethertype'] == constants.IPv4:
             raise ext_sg.SecurityGroupEthertypeConflictWithProtocol(
                 ethertype=rule['ethertype'], protocol=rule['protocol'])
示例#2
0
 def _validate_ethertype_and_protocol(self, rule):
     """Check if given ethertype and  protocol are valid or not"""
     if rule['protocol'] == constants.PROTO_NAME_ICMP_V6:
         if rule['ethertype'] == constants.IPv4:
             raise ext_sg.SecurityGroupEthertypeConflictWithProtocol(
                     ethertype=rule['ethertype'], protocol=rule['protocol'])