def enable_tproxy_rules(port, ipv6=False, mark=100):
    disable_tproxy_rules(ipv6, mark)
    try:
        run_ip_cmd((mark, mark) % "rule add fwmark %d table %d", ipv6=ipv6)
        run_ip_cmd("route add local default dev lo table %d" % mark, ipv6=ipv6)
        run_iptables_cmd("-t mangle -N %s" % TPROXY_CHAIN, ipv6=ipv6)

        add_local_bypass("mangle", TPROXY_CHAIN, ipv6)

        run_iptables_cmd(
                "-t mangle -A PREROUTING --jump %s" % TPROXY_CHAIN, ipv6=ipv6)

        run_iptables_cmd(
                "-t mangle -A %s -p tcp -j TPROXY --tproxy-mark %d --on-port %d" %
                (TPROXY_CHAIN, mark, port), ipv6=ipv6)

    except Exception:
        logger.exception("Failed to setup routing rules")
        disable_tproxy_rules(ipv6=ipv6, mark=mark)
dataset/ETHPy150Open google/nogotofail/nogotofail/mitm/util/routing.py/enable_tproxy_rules/swapped operands of `%`