Skip to content

Commit

Permalink
netfilter: SYNPROXY: let unrelated packets continue
Browse files Browse the repository at this point in the history
Packets reaching SYNPROXY were default dropped, as they were most
likely invalid (given the recommended state matching).  This
patch, changes SYNPROXY target to let packets, not consumed,
continue being processed by the stack.

This will be more in line other target modules. As it will allow
more flexible configurations of handling, logging or matching on
packets in INVALID states.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Jesper Dangaard Brouer authored and Pablo Neira Ayuso committed Sep 4, 2013
1 parent f4de4c8 commit 7cc9eb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions net/ipv4/netfilter/ipt_SYNPROXY.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,15 @@ synproxy_tg4(struct sk_buff *skb, const struct xt_action_param *par)
XT_SYNPROXY_OPT_ECN);

synproxy_send_client_synack(skb, th, &opts);
} else if (th->ack && !(th->fin || th->rst || th->syn))
return NF_DROP;

} else if (th->ack && !(th->fin || th->rst || th->syn)) {
/* ACK from client */
synproxy_recv_client_ack(snet, skb, th, &opts, ntohl(th->seq));
return NF_DROP;
}

return NF_DROP;
return XT_CONTINUE;
}

static unsigned int ipv4_synproxy_hook(unsigned int hooknum,
Expand Down
8 changes: 6 additions & 2 deletions net/ipv6/netfilter/ip6t_SYNPROXY.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,15 @@ synproxy_tg6(struct sk_buff *skb, const struct xt_action_param *par)
XT_SYNPROXY_OPT_ECN);

synproxy_send_client_synack(skb, th, &opts);
} else if (th->ack && !(th->fin || th->rst || th->syn))
return NF_DROP;

} else if (th->ack && !(th->fin || th->rst || th->syn)) {
/* ACK from client */
synproxy_recv_client_ack(snet, skb, th, &opts, ntohl(th->seq));
return NF_DROP;
}

return NF_DROP;
return XT_CONTINUE;
}

static unsigned int ipv6_synproxy_hook(unsigned int hooknum,
Expand Down

0 comments on commit 7cc9eb6

Please sign in to comment.