defaults: use a generic check_kmod() function
[project/firewall3.git] / redirects.c
index 660cdd2f3e94875b80499a8094cdb90558201ce6..6cd09f16143d84d3737c3157e4c3b23b1e280f94 100644 (file)
@@ -466,7 +466,7 @@ set_redirect(struct fw3_ipt_rule *r, struct fw3_port *port)
                if (port->port_min == port->port_max)
                        sprintf(buf, "%u", port->port_min);
                else
-                       sprintf(buf, "%u-%u", port->port_min, port->port_max);
+                       snprintf(buf, sizeof(buf), "%u-%u", port->port_min, port->port_max);
 
                fw3_ipt_rule_addarg(r, false, "--to-ports", buf);
        }
@@ -576,7 +576,7 @@ print_redirect(struct fw3_ipt_handle *h, struct fw3_state *state,
        case FW3_TABLE_RAW:
                if (redir->target == FW3_FLAG_DNAT && redir->helper.ptr)
                {
-                       if (redir->helper.ptr->proto.protocol != proto->protocol)
+                       if (!fw3_cthelper_check_proto(redir->helper.ptr, proto))
                        {
                                info("     ! Skipping protocol %s since helper '%s' does not support it",
                                     fw3_protoname(proto), redir->helper.ptr->name);