diff mbox

[nf,2/3] netfilter: ipvs: allow rescheduling after RST

Message ID 1455756061-21834-3-git-send-email-horms@verge.net.au
State Superseded
Delegated to: Pablo Neira
Headers show

Commit Message

Simon Horman Feb. 18, 2016, 12:41 a.m. UTC
From: Julian Anastasov <ja@ssi.bg>

"RFC 5961, 4.2. Mitigation" describes a mechanism to request
client to confirm with RST the restart of TCP connection
before resending its SYN. As result, IPVS can see SYNs for
existing connection in CLOSE state. Add check to allow
rescheduling in this state.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sergei Shtylyov Feb. 18, 2016, 1:17 p.m. UTC | #1
Hello.

On 2/18/2016 3:41 AM, Simon Horman wrote:

> From: Julian Anastasov <ja@ssi.bg>
>
> "RFC 5961, 4.2. Mitigation" describes a mechanism to request
> client to confirm with RST the restart of TCP connection
> before resending its SYN. As result, IPVS can see SYNs for
> existing connection in CLOSE state. Add check to allow
> rescheduling in this state.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>   net/netfilter/ipvs/ip_vs_core.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index 4da560005b0e..0c1d3fef9a7c 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1089,6 +1089,7 @@ static inline bool is_new_conn_expected(const struct ip_vs_conn *cp,
>   	switch (cp->protocol) {
>   	case IPPROTO_TCP:
>   		return (cp->state == IP_VS_TCP_S_TIME_WAIT) ||
> +			cp->state == IP_VS_TCP_S_CLOSE ||

    I would have been consistent and enclosed this expression into parens as 
well. BTW, the indentation is not correct anyway.

>   			((conn_reuse_mode & 2) &&
>   			 (cp->state == IP_VS_TCP_S_FIN_WAIT) &&
>   			 (cp->flags & IP_VS_CONN_F_NOOUTPUT));

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julian Anastasov March 5, 2016, 1:01 p.m. UTC | #2
Hello,

On Thu, 18 Feb 2016, Sergei Shtylyov wrote:

> On 2/18/2016 3:41 AM, Simon Horman wrote:
> 
> > From: Julian Anastasov <ja@ssi.bg>
> >
> > "RFC 5961, 4.2. Mitigation" describes a mechanism to request
> > client to confirm with RST the restart of TCP connection
> > before resending its SYN. As result, IPVS can see SYNs for
> > existing connection in CLOSE state. Add check to allow
> > rescheduling in this state.
> >
> > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > Signed-off-by: Simon Horman <horms@verge.net.au>
> > ---
> >   net/netfilter/ipvs/ip_vs_core.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/net/netfilter/ipvs/ip_vs_core.c
> > b/net/netfilter/ipvs/ip_vs_core.c
> > index 4da560005b0e..0c1d3fef9a7c 100644
> > --- a/net/netfilter/ipvs/ip_vs_core.c
> > +++ b/net/netfilter/ipvs/ip_vs_core.c
> > @@ -1089,6 +1089,7 @@ static inline bool is_new_conn_expected(const struct
> > ip_vs_conn *cp,
> >    switch (cp->protocol) {
> >    case IPPROTO_TCP:
> >   		return (cp->state == IP_VS_TCP_S_TIME_WAIT) ||
> > +			cp->state == IP_VS_TCP_S_CLOSE ||
> 
>    I would have been consistent and enclosed this expression into parens as
> well. BTW, the indentation is not correct anyway.

	Thanks! I'll send new version...

> 
> >      ((conn_reuse_mode & 2) &&
> >       (cp->state == IP_VS_TCP_S_FIN_WAIT) &&
> >       (cp->flags & IP_VS_CONN_F_NOOUTPUT));
> 
> MBR, Sergei

Regards

--
Julian Anastasov <ja@ssi.bg>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 4da560005b0e..0c1d3fef9a7c 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1089,6 +1089,7 @@  static inline bool is_new_conn_expected(const struct ip_vs_conn *cp,
 	switch (cp->protocol) {
 	case IPPROTO_TCP:
 		return (cp->state == IP_VS_TCP_S_TIME_WAIT) ||
+			cp->state == IP_VS_TCP_S_CLOSE ||
 			((conn_reuse_mode & 2) &&
 			 (cp->state == IP_VS_TCP_S_FIN_WAIT) &&
 			 (cp->flags & IP_VS_CONN_F_NOOUTPUT));