def is_icmp_reply(pkt, ipformat):
    """Return True if pkt is echo reply, else return False. If exception occurs
    return False.

    :param pkt: Packet.
    :param ipformat: Dictionary of names to distinguish IPv4 and IPv6.
    :type pkt: dict
    :type ipformat: dict
    :rtype: bool
    """
    # pylint: disable=bare-except
    try:
        if pkt[ipformat['IPType']][ipformat['ICMP_rep']].type == \
                ipformat['Type']:
            return True
        else:
            return False
    except: # pylint: disable=bare-except
        return False