def subintf_real_ip_check_gw_port(self, gw_port, ip_addr, netmask):
if gw_port is not None:<EOL><INDENT>found = False<EOL>for i in range(len(gw_port['<STR_LIT>'])):<EOL><INDENT>target_ip = gw_port['<STR_LIT>'][i]['<STR_LIT>']<EOL>if ip_addr == target_ip:<EOL><INDENT>found = True<EOL>break<EOL><DEDENT><DEDENT>if found is False:<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>return False<EOL><DEDENT>subnet_id = gw_port['<STR_LIT>'][i]['<STR_LIT>']<EOL>subnet = next(<EOL>sn for sn in gw_port['<STR_LIT>'] if sn['<STR_LIT:id>'] == subnet_id)<EOL>target_net = netaddr.IPNetwork(subnet['<STR_LIT>'])<EOL>if netmask != str(target_net.netmask):<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>return False<EOL><DEDENT>return True<EOL><DEDENT>return False<EOL>
checks running-cfg derived ip_addr and netmask against neutron-db
gw_port