Skip to content

Commit 7cc9eb6

Browse files
netoptimizerummakynes
authored andcommitted
netfilter: SYNPROXY: let unrelated packets continue
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>
1 parent f4de4c8 commit 7cc9eb6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

net/ipv4/netfilter/ipt_SYNPROXY.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,15 @@ synproxy_tg4(struct sk_buff *skb, const struct xt_action_param *par)
285285
XT_SYNPROXY_OPT_ECN);
286286

287287
synproxy_send_client_synack(skb, th, &opts);
288-
} else if (th->ack && !(th->fin || th->rst || th->syn))
288+
return NF_DROP;
289+
290+
} else if (th->ack && !(th->fin || th->rst || th->syn)) {
289291
/* ACK from client */
290292
synproxy_recv_client_ack(snet, skb, th, &opts, ntohl(th->seq));
293+
return NF_DROP;
294+
}
291295

292-
return NF_DROP;
296+
return XT_CONTINUE;
293297
}
294298

295299
static unsigned int ipv4_synproxy_hook(unsigned int hooknum,

net/ipv6/netfilter/ip6t_SYNPROXY.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,15 @@ synproxy_tg6(struct sk_buff *skb, const struct xt_action_param *par)
300300
XT_SYNPROXY_OPT_ECN);
301301

302302
synproxy_send_client_synack(skb, th, &opts);
303-
} else if (th->ack && !(th->fin || th->rst || th->syn))
303+
return NF_DROP;
304+
305+
} else if (th->ack && !(th->fin || th->rst || th->syn)) {
304306
/* ACK from client */
305307
synproxy_recv_client_ack(snet, skb, th, &opts, ntohl(th->seq));
308+
return NF_DROP;
309+
}
306310

307-
return NF_DROP;
311+
return XT_CONTINUE;
308312
}
309313

310314
static unsigned int ipv6_synproxy_hook(unsigned int hooknum,

0 commit comments

Comments
 (0)